From 34f0e98080fe05f57310534d7623d2d1a598362e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 11 Nov 2018 00:46:16 +0100 Subject: [PATCH] plug a memory leak, delete 'element', if tmalloced before --- src/xspice/mif/mifsetup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xspice/mif/mifsetup.c b/src/xspice/mif/mifsetup.c index e10d89edd..e2672e64e 100644 --- a/src/xspice/mif/mifsetup.c +++ b/src/xspice/mif/mifsetup.c @@ -455,6 +455,9 @@ MIFunsetup(GENmodel *inModel,CKTcircuit *ckt) for (model = (MIFmodel *)inModel; model != NULL; model = MIFnextModel(model)) { + for (i = 0; i < model->num_param; i++) + if (model->param[i]->is_null) + tfree(model->param[i]->element); for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { /* Skip these expensive allocations if the instance is not analog */ if(! here->analog)