Fix memory leak of parm when there is a closing ).

This commit is contained in:
Brian Taylor 2025-02-16 16:09:42 -08:00 committed by Holger Vogt
parent 34046a29c1
commit 08aff1ee17
1 changed files with 3 additions and 1 deletions

View File

@ -198,8 +198,10 @@ char *MIFgetMod(
num_pars = *device->numModelParms;
while (*line != '\0') {
INPgetTok(&line, &parm, 1);
if (!parm || !*parm) // May be closing ')'.
if (!parm || !*parm) { // May be closing ')'.
FREE(parm);
break;
}
for (j = 0; j < num_pars; j++) {
if (strcmp(parm, device->modelParms[j].keyword) == 0) {
err1 = NULL;