summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-03-01 16:48:23 -0500
committerMatt Turner <mattst88@gmail.com>2012-03-14 12:50:41 -0400
commitc3dd42dbd2aaf95d2a1d08a52d9c2e7056ef7ac9 (patch)
treed228e2893d87810d5101e2bfd95f180da2d5aac8 /src
parent7fd6427bc3016e9666a587386779952cf8979f09 (diff)
Fix use-after-free in DestroyAllIM
Fixes segmentation fault when closing gv. Found at http://gitorious.org/xaw3d/xaw3d/commit/23b3ca50395f180cba4a923eb8827dcc961629da Fixes: https://bugs.gentoo.org/show_bug.cgi?id=406487 Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/XawIm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/XawIm.c b/src/XawIm.c
index 82a94b1..00562b5 100644
--- a/src/XawIm.c
+++ b/src/XawIm.c
@@ -320,12 +320,12 @@ DestroyAllIM(XawVendorShellExtPart *ve)
/*
* Close Input Method
*/
- CloseIM(ve);
if (!XFindContext(XDisplayOfIM(ve->im.xim), (Window)ve->im.xim, errContext,
(XPointer*)&contextErrData)) {
if (contextErrData) XtFree((char *)contextErrData);
}
XDeleteContext(XDisplayOfIM(ve->im.xim), (Window)ve->im.xim, errContext);
+ CloseIM(ve);
ve->im.xim = NULL;
/*