spiceif.c, remove memory leak ** to be tested thouroughly **

This commit is contained in:
h_vogt 2016-07-17 17:36:36 +02:00 committed by rlar
parent 16da4a20fd
commit ffed264540
1 changed files with 7 additions and 1 deletions

View File

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