Commit 089709f7 authored by jdgleaver's avatar jdgleaver
Browse files

Fix memory leak

parent cb0dfc93
......@@ -133,6 +133,18 @@ static char *Safe (const char *s)
int i;
static char *safe = NULL;
static int safe_len = 0;
if (s == NULL)
{
if (safe)
{
free(safe);
safe = NULL;
safe_len = 0;
}
return NULL;
}
int len = strlen (s);
if (!safe || len + 1 > safe_len)
......@@ -269,6 +281,10 @@ void MemoryDeinit ()
}
FreeSDD1Data ();
/* Ensure that we free the static char
* array allocated by Safe() */
Safe(NULL);
}
void FreeSDD1Data ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment