aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>2011-03-24 20:40:41 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:25 +0200
commit9fa1e98dd7c3481f8e1a0d31037c01c5b02440fc (patch)
treee0ad2993520f6ccecf042197905d766b36512a79
parent748cf8946537e0c199cbf2f19cdc582001ea8232 (diff)
downloadnx-libs-9fa1e98dd7c3481f8e1a0d31037c01c5b02440fc.tar.gz
nx-libs-9fa1e98dd7c3481f8e1a0d31037c01c5b02440fc.tar.bz2
nx-libs-9fa1e98dd7c3481f8e1a0d31037c01c5b02440fc.zip
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> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
-rw-r--r--nx-X11/lib/X11/omGeneric.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nx-X11/lib/X11/omGeneric.c b/nx-X11/lib/X11/omGeneric.c
index dbddc8415..1b017cb21 100644
--- a/nx-X11/lib/X11/omGeneric.c
+++ b/nx-X11/lib/X11/omGeneric.c
@@ -1910,8 +1910,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)