[PATCH libxi] Fix possible free of uninitialized pointer

Emilio Pozuelo Monfort pochu at debian.org
Thu Dec 22 18:16:43 UTC 2016


If the _XReply() call fails, we'll try to free an uninitialized
pointer.

Signed-off-by: Emilio Pozuelo Monfort <pochu at debian.org>
---
 src/XIQueryDevice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XIQueryDevice.c b/src/XIQueryDevice.c
index a877d78..51e2d0d 100644
--- a/src/XIQueryDevice.c
+++ b/src/XIQueryDevice.c
@@ -46,7 +46,7 @@ XIQueryDevice(Display *dpy, int deviceid, int *ndevices_return)
     char                *ptr;
     char                *end;
     int                 i;
-    char                *buf;
+    char                *buf = NULL;
 
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
-- 
2.11.0



More information about the xorg-devel mailing list