[10/16] Fix memory leak on _XimGetAttributeID error path.

Submitted by Ander Conselvan de Oliveira on March 30, 2011, 8:12 p.m.

Details

Message ID 1301490729-22084-11-git-send-email-ander.conselvan-de-oliveira@nokia.com
State Deferred, archived
Headers show

Not browsing as part of any series.

Commit Message

Ander Conselvan de Oliveira March 30, 2011, 8:12 p.m.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
---
 modules/im/ximcp/imRmAttr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

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;