Commit 75de0f3d authored by Alan Coopersmith's avatar Alan Coopersmith

Fix memory leak on failure in getFontencCharset

Error: Memory leak (CWE 401)
   Memory leak of pointer 'c' allocated with malloc(80)
        at line 297 of app/luit/charset.c in function 'getFontencCharset'.
          'c' allocated at line 290 with malloc(80).
        at line 303 of app/luit/charset.c in function 'getFontencCharset'.
          'c' allocated at line 290 with malloc(80).

[ This bug was found by the Parfait 0.4.2 bug checking tool.
  For more information see http://labs.oracle.com/projects/parfait/ ]
Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 525785fd
......@@ -293,12 +293,14 @@ getFontencCharset(unsigned final, int type, const char *name)
mapping = FontEncMapFind(fc->xlfd, FONT_ENCODING_UNICODE, -1, -1, NULL);
if (!mapping) {
free(c);
fc->type = T_FAILED;
return NULL;
}
reverse = FontMapReverse(mapping);
if (!reverse) {
free(c);
fc->type = T_FAILED;
return NULL;
}
......
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