Ignore:
Timestamp:
2021-05-18T13:40:26+02:00 (3 years ago)
Author:
GitHub <noreply@…>
Branches:
maintenance/v1.17
Parents:
f1024952
git-author:
Andreas <38031952+AnHeuermann@…> (05/18/21 13:40:26)
git-committer:
GitHub <noreply@…> (05/18/21 13:40:26)
Message:

Fix memory leak of model info xml data (#7473)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/SimulationRuntime/c/simulation/simulation_info_json.c

    rad22570 r03f0da6b  
    394394  }
    395395#endif
     396  assert(xml->functionNames == NULL);
    396397  xml->functionNames = (FUNCTION_INFO*) calloc(xml->nFunctions, sizeof(FUNCTION_INFO));
     398  assert(xml->equationInfo == NULL);
    397399  xml->equationInfo = (EQUATION_INFO*) calloc(1+xml->nEquations, sizeof(EQUATION_INFO));
    398400  xml->equationInfo[0].id = 0;
     
    411413}
    412414
     415/**
     416 * @brief Deinitialize memory allocated by modelInfoInit
     417 *
     418 * @param xml   Pointer to model info xml data.
     419 */
     420void modelInfoDeinit(MODEL_DATA_XML* xml)
     421{
     422  free(xml->functionNames); xml->functionNames = NULL;
     423  free(xml->equationInfo); xml->equationInfo = NULL;
     424}
     425
    413426FUNCTION_INFO modelInfoGetFunction(MODEL_DATA_XML* xml, size_t ix)
    414427{
Note: See TracChangeset for help on using the changeset viewer.