mkfnode(), fix a memory leak

This commit is contained in:
rlar 2012-10-17 19:39:02 +02:00
parent 31fa48cf17
commit f038d59fbe
1 changed files with 2 additions and 0 deletions

View File

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