Browse Source

frontend/cpitf.c, free a temporary vector which was left in `cp_istrue()'

reported by Marcel Hendrix.

Using conditional expressions within a .control sequence
  left some garbage vectors in the current plot.

For example

> let ix = 0
>
> while ix < 2
>   let ix = ix + 1
> end
>
> display

"display" reported a variable named "ix < 2"
which was an internal temporary value in said function `cp_istrue()'
pre-master-46
rlar 11 years ago
parent
commit
6ff1560487
  1. 7
      src/frontend/cpitf.c

7
src/frontend/cpitf.c

@ -315,7 +315,12 @@ cp_istrue(wordlist *wl)
v = ft_evaluate(names);
rv = !vec_iszero(v);
free_pnode(names);
/* va: garbage collection for v, if pnode names is no simple value */
if (names->pn_value == NULL && v != NULL)
vec_free(v);
free_pnode(names); /* free also v, if pnode names is simple value */
return rv;
}

Loading…
Cancel
Save