[07/16] Fix memory leak on _XimCommitRecv error path.

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

Details

Message ID 1301490729-22084-8-git-send-email-ander.conselvan-de-oliveira@nokia.com
State Accepted, archived
Commit 46e6c78b1a89e4774e0f7e0f4d6d0fd060c3897e
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/imDefLkup.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/modules/im/ximcp/imDefLkup.c b/modules/im/ximcp/imDefLkup.c
index f818faa..996d36a 100644
--- a/modules/im/ximcp/imDefLkup.c
+++ b/modules/im/ximcp/imDefLkup.c
@@ -691,8 +691,10 @@  _XimCommitRecv(
 	    return False;
 
 	if (!(_XimProcCommit(ic, (BYTE *)&buf_s[5],
-			 		(int)buf_s[4], &string, &string_len)))
+					(int)buf_s[4], &string, &string_len))) {
+	    Xfree(keysym);
 	    return False;
+	}
     }
 
     if (!(_XimRegCommitInfo(ic, string, string_len, keysym, keysym_len))) {