diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-12-05 20:47:09 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-12-05 20:47:09 -0800 |
commit | 75de0f3d8b7bd9541a8a9528ab63e51fa9c57b17 (patch) | |
tree | a9fe08349ebe16f2be0e2ff75d0cb956a4c888ce | |
parent | 525785fd7beca872ebeeb8bb6c22d82459128788 (diff) |
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 <alan.coopersmith@oracle.com>
-rw-r--r-- | charset.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |