Remove memory leak in the 'show' command.

Needs some more testing, as val is not always instanciated by malloc.
This commit is contained in:
Holger Vogt 2026-07-06 10:42:04 +02:00
parent ee9578055f
commit eb68de42d0
1 changed files with 4 additions and 0 deletions

View File

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