Skip to content

Commit

Permalink
Also free the tableFiles array
Browse files Browse the repository at this point in the history
While this frees parts of the memory we neglect to free the strings
inside the array. This still needs to be done.
  • Loading branch information
egli committed May 20, 2014
1 parent f726afa commit 63dd676
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion liblouis/compileTranslationTable.c
Expand Up @@ -4785,22 +4785,27 @@ includeFile (FileInfo * nested, CharsString * includedFile)
int k;
char includeThis[MAXSTRING];
char **tableFiles;
int rv;
for (k = 0; k < includedFile->length; k++)
includeThis[k] = (char) includedFile->chars[k];
includeThis[k] = 0;
tableFiles = resolveTable (includeThis, nested->fileName);
if (tableFiles == NULL)
{
errorCount++;
free(tableFiles);
return 0;
}
if (tableFiles[1] != NULL)
{
errorCount++;
free(tableFiles);
lou_logPrint ("Table list not supported in include statement: 'include %s'", includeThis);
return 0;
}
return compileFile (*tableFiles);
rv = compileFile (*tableFiles);
free(tableFiles);
return rv;
}

/**
Expand Down Expand Up @@ -4845,6 +4850,7 @@ compileTranslationTable (const char *tableList)

/* Clean up after compiling files */
cleanup:
free(tableFiles);
if (characterClasses)
deallocateCharacterClasses ();
if (ruleNames)
Expand Down

0 comments on commit 63dd676

Please sign in to comment.