plug a memory leak after (internal) call to altermod

This commit is contained in:
Holger Vogt 2018-09-02 14:51:14 +02:00
parent 3138811acd
commit 40e69ceaf4
1 changed files with 2 additions and 0 deletions

View File

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