free(local_impart) since that's where the allocated memory is stored
immediately from the calloc call, instead of relying on the pointer
being copied into im->private, since that only happens after the call
to goto Error2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93183
Signed-off-by: Alan Coopersmith <[email protected]>
---
 src/xlibi18n/XDefaultIMIF.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xlibi18n/XDefaultIMIF.c b/src/xlibi18n/XDefaultIMIF.c
index 2eb52ae..e691e03 100644
--- a/src/xlibi18n/XDefaultIMIF.c
+++ b/src/xlibi18n/XDefaultIMIF.c
@@ -232,8 +232,8 @@ _XDefaultOpenIM(
 
     return (XIM)im;
 Error2 :
-    Xfree(im->private);
     Xfree(im->core.im_name);
+    Xfree(local_impart);
     Xfree(im);
     _XlcCloseConverter(ctom_conv);
     _XlcCloseConverter(ctow_conv);
-- 
2.6.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to