Skip to content

Commit

Permalink
[OMCompiler] Fix some leaks in C runtime (#7442)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed May 6, 2021
1 parent bcf875b commit 85330b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OMCompiler/SimulationRuntime/c/simulation/solver/model_help.c
Expand Up @@ -1190,6 +1190,7 @@ void deInitializeDataStruc(DATA *data)
free(data->simulationInfo->relationsPre);
free(data->simulationInfo->storedRelations);
free(data->simulationInfo->zeroCrossingIndex);
free(data->simulationInfo->mathEventsValuePre);

/* free buffer for old state variables */
free(data->simulationInfo->realVarsOld);
Expand Down Expand Up @@ -1231,6 +1232,11 @@ void deInitializeDataStruc(DATA *data)
/* free buffer for state sets */
omc_alloc_interface.free_uncollectable(data->simulationInfo->daeModeData);

/* buffer for inline Data */
free(data->simulationInfo->inlineData->algVars);
free(data->simulationInfo->inlineData->algOldVars);
omc_alloc_interface.free_uncollectable(data->simulationInfo->inlineData);

/* free inputs and output */
free(data->simulationInfo->inputVars);
free(data->simulationInfo->outputVars);
Expand Down

0 comments on commit 85330b0

Please sign in to comment.