From 6ff1560487b6deaac60c0e385fd0c4496a1c673c Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 2 May 2015 12:33:45 +0200 Subject: [PATCH] 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()' --- src/frontend/cpitf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend/cpitf.c b/src/frontend/cpitf.c index 28fe87906..d1aaeff2c 100644 --- a/src/frontend/cpitf.c +++ b/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; }