[PATCH 10/16] Fix memory leak on _XimGetAttributeID error path.
Ander Conselvan de Oliveira
ander.conselvan-de-oliveira at nokia.com
Wed Mar 30 06:12:03 PDT 2011
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
---
modules/im/ximcp/imRmAttr.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c
index 0471f3d..d91aa7d 100644
--- a/modules/im/ximcp/imRmAttr.c
+++ b/modules/im/ximcp/imRmAttr.c
@@ -1433,8 +1433,10 @@ _XimGetAttributeID(
bzero((char *)res, res_len);
values_len = sizeof(XIMValuesList) + (sizeof(char **) * n) + names_len;
- if (!(tmp = (XPointer)Xmalloc(values_len)))
+ if (!(tmp = (XPointer)Xmalloc(values_len))) {
+ Xfree(res);
return False;
+ }
bzero(tmp, values_len);
values_list = (XIMValuesList *)tmp;
--
1.7.0.4
More information about the xorg-devel
mailing list