Skip to content

Commit

Permalink
- fix invalid free of constants
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Mar 14, 2023
1 parent 0d50ed8 commit 2d63255
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/bindings/matlab/StructureFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,18 @@ StructureFields::populateFields()

// get structure returns fieldnames, default values and value types
// fieldnames are an array of arrays giving values for several aspects of the structure
// SBMLfieldnames = { {'typecode','','',0,0}, ...
//{'metaid', 'metaid', '', 1, 20}, ...
//{'notes', 'notes', '', 1, 1}, ...
//{'annotation', 'annotation', '', 1, 2}, ...
//{'formula', 'formula', '', 1, 5}, ...
//{'variable', 'variable', '', 1, 20}, ...
//{'species', 'species', '', 1, 20}, ...
//{'compartment', 'compartment', '', 1, 20}, ...
//{'name', 'name', '', 1, 20}, ...
//{'units', 'units', '', 1, 20}, ...
//
//{name of the field, sbml name, prefix, is sbml attribute, type enum}
// SBMLfieldnames = { {'typecode','','',0,0}, ...
//{'metaid', 'metaid', '', 1, 20}, ...
//{'notes', 'notes', '', 1, 1}, ...
//{'annotation', 'annotation', '', 1, 2}, ...
//{'formula', 'formula', '', 1, 5}, ...
//{'variable', 'variable', '', 1, 20}, ...
//{'species', 'species', '', 1, 20}, ...
//{'compartment', 'compartment', '', 1, 20}, ...
//{'name', 'name', '', 1, 20}, ...
//{'units', 'units', '', 1, 20}, ...
//
//{name of the field, sbml name, prefix, is sbml attribute, type enum}

for (unsigned int i = 0; i < nNumberFields; ++i)
{
Expand Down Expand Up @@ -539,10 +539,10 @@ StructureFields::getNamespacesStructure()
* a string that is NULL
*/
if (pacPrefix == NULL) {
pacPrefix = "";
pacPrefix = safe_strdup("");
}
if (pacURI == NULL) {
pacURI = "";
pacURI = safe_strdup("");
}

mxSetField(mxNSReturn, i, "prefix", mxCreateString(pacPrefix));
Expand Down

0 comments on commit 2d63255

Please sign in to comment.