diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 29020fd9c..4eaf32f11 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -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));