[PATCH 04/16] Fix memory leaks on _XimProtoCreateIC error paths.
Ander Conselvan de Oliveira
ander.conselvan-de-oliveira at nokia.com
Wed Mar 30 06:11:57 PDT 2011
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
---
modules/im/ximcp/imDefIc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/im/ximcp/imDefIc.c b/modules/im/ximcp/imDefIc.c
index be74a2c..9283c49 100644
--- a/modules/im/ximcp/imDefIc.c
+++ b/modules/im/ximcp/imDefIc.c
@@ -1436,7 +1436,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;
@@ -1464,7 +1464,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;
--
1.7.0.4
More information about the xorg-devel
mailing list