aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>2011-03-24 19:36:56 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:26 +0200
commit3720ed7bf1528a51c426fd9892a23a1204bbc461 (patch)
tree8685d236e021c0e1d86c80a664c8b85f3d6d0095 /nx-X11/lib/X11
parentb7cc762ba5b2b724d9181bdf81870bac0e469554 (diff)
downloadnx-libs-3720ed7bf1528a51c426fd9892a23a1204bbc461.tar.gz
nx-libs-3720ed7bf1528a51c426fd9892a23a1204bbc461.tar.bz2
nx-libs-3720ed7bf1528a51c426fd9892a23a1204bbc461.zip
Fix memory leaks on _XimProtoCreateIC error paths.
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>
Diffstat (limited to 'nx-X11/lib/X11')
-rw-r--r--nx-X11/lib/X11/imDefIc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nx-X11/lib/X11/imDefIc.c b/nx-X11/lib/X11/imDefIc.c
index dab0e3c75..6db54bcc2 100644
--- a/nx-X11/lib/X11/imDefIc.c
+++ b/nx-X11/lib/X11/imDefIc.c
@@ -1431,7 +1431,7 @@ _XimProtoCreateIC(
num = im->core.ic_num_resources;
len = sizeof(XIMResource) * num;
if (!(res = (XIMResourceList)Xmalloc(len)))
- return (XIC)NULL;
+ goto ErrorOnCreatingIC;
(void)memcpy((char *)res, (char *)im->core.ic_resources, len);
ic->private.proto.ic_resources = res;
ic->private.proto.ic_num_resources = num;
@@ -1459,7 +1459,7 @@ _XimProtoCreateIC(
num = im->private.proto.ic_num_inner_resources;
len = sizeof(XIMResource) * num;
if (!(res = (XIMResourceList)Xmalloc(len)))
- return (XIC)NULL;
+ goto ErrorOnCreatingIC;
(void)memcpy((char *)res,
(char *)im->private.proto.ic_inner_resources, len);
ic->private.proto.ic_inner_resources = res;