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()'
This commit is contained in:
rlar 2015-05-02 12:33:45 +02:00
parent e609c7411d
commit 6ff1560487
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}