From f038d59fbe2dd4bf84419c81b1c499efda8f2785 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 17 Oct 2012 19:39:02 +0200 Subject: [PATCH] mkfnode(), fix a memory leak --- src/frontend/parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frontend/parse.c b/src/frontend/parse.c index 612a2172b..81adc1958 100644 --- a/src/frontend/parse.c +++ b/src/frontend/parse.c @@ -288,6 +288,7 @@ mkfnode(const char *func, struct pnode *arg) if ((f->fu_name == NULL) && arg->pn_value) { /* Kludge -- maybe it is really a variable name. */ (void) sprintf(buf, "%s(%s)", func, arg->pn_value->v_name); + free_pnode(arg); d = vec_get(buf); if (d == NULL) { /* Well, too bad. */ @@ -300,6 +301,7 @@ mkfnode(const char *func, struct pnode *arg) } else if (f->fu_name == NULL) { fprintf(cp_err, "Error: no function as %s with that arity.\n", func); + free_pnode(arg); return (NULL); }