summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-10-08 09:57:09 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-10-08 09:57:09 -0700
commite8db0fc7c047ccdd6c11381681b184bbe9ea8270 (patch)
tree145ae74fadeaec3099de615329e819abfd417b44
parent7bed7727a86096a0f83a785a5a9a2ecad50507d9 (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Xge.c b/src/Xge.c
index 4c4297f..2e4ab12 100644
--- a/src/Xge.c
+++ b/src/Xge.c
@@ -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)