mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
mkfnode(), fix a memory leak
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user