summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>2011-03-24 20:40:41 +0200
committerAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>2011-04-13 11:05:59 +0300
commitd0749d6abdf0fd4d8b4e59b02dad8ccda3f10995 (patch)
tree4eb2d268742378209d7b79df6c5c22bec24c69af
parent4b2e8d00f5b6969c14003ee8eb258b9f0e4dd7c3 (diff)
om: Fix memory leak on read_EncodingInfo error path.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--modules/om/generic/omGeneric.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/om/generic/omGeneric.c b/modules/om/generic/omGeneric.c
index c78c0a9..0029093 100644
--- a/modules/om/generic/omGeneric.c
+++ b/modules/om/generic/omGeneric.c
@@ -1932,8 +1932,10 @@ read_EncodingInfo(
} else
len = strlen(buf);
font_data->name = (char *) Xmalloc(len + 1);
- if (font_data->name == NULL)
+ if (font_data->name == NULL) {
+ Xfree(font_data);
return NULL;
+ }
strncpy(font_data->name, buf,len);
font_data->name[len] = 0;
if (bufptr && _XlcCompareISOLatin1(bufptr, "GL") == 0)