mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-09-08 06:07:32 +02:00
Remove memory leak in the 'show' command.
Needs some more testing, as val is not always instanciated by malloc.
This commit is contained in:
@@ -1002,6 +1002,8 @@ printvals_old(dgen *dg, IFparm *p, int i)
|
||||
IFvalue val;
|
||||
int n, error;
|
||||
|
||||
memset(&val, 0, sizeof val);
|
||||
|
||||
if (dg->flags & DGEN_INSTANCE)
|
||||
error = ft_sim->askInstanceQuest
|
||||
(ft_curckt->ci_ckt, dg->instance, p->id, &val, &val);
|
||||
@@ -1081,6 +1083,8 @@ printvals_old(dgen *dg, IFparm *p, int i)
|
||||
fprintf(cp_out, " %*.*s", DEV_WIDTH, DEV_WIDTH, " ******** ");
|
||||
}
|
||||
}
|
||||
if (p->dataType & IF_VECTOR)
|
||||
tfree(val.v.vec.rVec);
|
||||
|
||||
return n - 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user