TMXR: Fix potential memory leak when already out of memory
This commit is contained in:
parent
64b1223468
commit
c4bbb75303
1 changed files with 2 additions and 1 deletions
|
@ -5233,7 +5233,8 @@ if (set == NULL) { /* if the allocation fai
|
||||||
|
|
||||||
tbuf = (char *) calloc (strlen(cptr)+2, sizeof(*cptr));
|
tbuf = (char *) calloc (strlen(cptr)+2, sizeof(*cptr));
|
||||||
if (tbuf == NULL) { /* if the allocation failed */
|
if (tbuf == NULL) { /* if the allocation failed */
|
||||||
free (tbuf); /* then free the successful list allocation */
|
free (set); /* then free the line set tracking array */
|
||||||
|
free (list); /* and successful list allocation */
|
||||||
return SCPE_MEM; /* and report a "Memory exhausted" error */
|
return SCPE_MEM; /* and report a "Memory exhausted" error */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue