diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-10-08 09:57:09 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-10-08 09:57:09 -0700 |
commit | e8db0fc7c047ccdd6c11381681b184bbe9ea8270 (patch) | |
tree | 145ae74fadeaec3099de615329e819abfd417b44 | |
parent | 7bed7727a86096a0f83a785a5a9a2ecad50507d9 (diff) |
_xgeDpyClose: handle NULL return from _xgeFindDisplay
Resolves gcc warning:
Xge.c: In function ‘_xgeDpyClose’:
Xge.c:211:13: warning: dereference of NULL ‘info’ [CWE-476]
[-Wanalyzer-null-dereference]
211 | if (info->data != NULL) {
| ~~~~^~~~~~
Fixes: 850263a ("Add GenericEvent extension (XGE).")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/Xge.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -208,7 +208,7 @@ _xgeDpyClose(Display* dpy, XExtCodes* codes) { XExtDisplayInfo *info = _xgeFindDisplay(dpy); - if (info->data != NULL) { + if (info != NULL && info->data != NULL) { XGEData* xge_data = (XGEData*)info->data; if (xge_data->extensions) |