spiceif.c, remove memory leak ** to be tested thouroughly **
This commit is contained in:
parent
ec083630bc
commit
a2f69530a5
|
|
@ -732,8 +732,14 @@ spif_getparam_special(CKTcircuit *ckt, char **name, char *param, int ind, int do
|
|||
return (NULL);
|
||||
}
|
||||
pv = doask(ckt, typecode, dev, mod, opt, ind);
|
||||
if (pv)
|
||||
if (pv) {
|
||||
vv = parmtovar(pv, opt);
|
||||
/* free only for VSRC and ISRC because they are definitely TMALLOCed,
|
||||
when numValue as length of vector > 0.
|
||||
All others will cause harm. */
|
||||
if (pv->v.vec.rVec && (pv->v.numValue > 0) && ((typecode == 49) || (typecode == 30)))
|
||||
tfree(pv->v.vec.rVec);
|
||||
}
|
||||
return (vv);
|
||||
} else {
|
||||
return (if_getstat(ckt, *name));
|
||||
|
|
|
|||
Loading…
Reference in New Issue