summaryrefslogtreecommitdiff
path: root/src/xkb/XKBUse.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2020-10-31 09:24:01 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2020-11-18 14:27:59 -0800
commit103e2e11519984aa5746c06e7d90d1f5bc8174a3 (patch)
treec71507bfbc6000909cbea883b8954889451a137d /src/xkb/XKBUse.c
parent7d70e302218e2ec8518548ddcdc02d828e7889af (diff)
downloadxorg-lib-libX11-103e2e11519984aa5746c06e7d90d1f5bc8174a3.tar.gz
Don't leave dangling pointers in Free functions
While these are mostly called during teardown of larger structures that are about to themselves be freed, there's no guarantee that will always be the case, so try to be safer here. [ This bug was found by the Parfait 4.0 bug checking tool. http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ] v2: Deduplicate & simplify pointer clearing in _XFreeEventCookies as suggested by @keithp Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/xkb/XKBUse.c')
-rw-r--r--src/xkb/XKBUse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/xkb/XKBUse.c b/src/xkb/XKBUse.c
index 3194137e..ab5027b0 100644
--- a/src/xkb/XKBUse.c
+++ b/src/xkb/XKBUse.c
@@ -612,6 +612,7 @@ _XkbFreeInfo(Display *dpy)
if (xkbi->desc)
XkbFreeKeyboard(xkbi->desc, XkbAllComponentsMask, True);
Xfree(xkbi);
+ dpy->xkb_info = NULL;
}
}