From 40e69ceaf4656f31e0c0067fd0cf5845445564d7 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 2 Sep 2018 14:51:14 +0200 Subject: [PATCH] plug a memory leak after (internal) call to altermod --- src/xspice/mif/mifmpara.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xspice/mif/mifmpara.c b/src/xspice/mif/mifmpara.c index 5fb0b8a2e..7b5a1fb97 100644 --- a/src/xspice/mif/mifmpara.c +++ b/src/xspice/mif/mifmpara.c @@ -109,6 +109,8 @@ int MIFmParam( /* initialize the parameter is_null and size elements and allocate elements */ model->param[param_index]->is_null = MIF_FALSE; + /* element may exist already, if called from 'altermod' */ + FREE(model->param[param_index]->element); if(is_array) { model->param[param_index]->size = value->v.numValue; model->param[param_index]->element = TMALLOC(Mif_Value_t, value->v.numValue);