Skip to content

Commit

Permalink
Fix memory leak, make code a bit more readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkager committed Feb 2, 2016
1 parent c7f9c80 commit 142f49f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions liblouis/compileTranslationTable.c
Expand Up @@ -4041,7 +4041,7 @@ compileRule (FileInfo * nested)
char * s = malloc(sizeof(char) * (emphClass.length + 1));
for (k = 0; k < emphClass.length; k++)
s[k] = (char)emphClass.chars[k];
s[k++] = '\0';
s[emphClass.length] = '\0';
for (i = 0; table->emphClasses[i]; i++)
if (strcmp(s, table->emphClasses[i]) == 0)
{
Expand Down Expand Up @@ -4128,7 +4128,7 @@ compileRule (FileInfo * nested)
char * s = malloc(sizeof(char) * (emphClass.length + 1));
for (k = 0; k < emphClass.length; k++)
s[k] = (char)emphClass.chars[k];
s[k++] = '\0';
s[emphClass.length] = '\0';
for (i = 0; table->emphClasses[i]; i++)
if (strcmp(s, table->emphClasses[i]) == 0)
{
Expand Down

0 comments on commit 142f49f

Please sign in to comment.