[PATCH xf86-input-libinput] Initialize variable 'path' to NULL to silence warning

Boyan Ding boyan.j.ding at gmail.com
Thu Mar 5 18:22:15 PST 2015


  CC       libinput.lo
libinput.c: In function 'xf86libinput_pre_init':
libinput.c:1222:2: warning: 'path' may be used uninitialized in this
function [-Wmaybe-uninitialized]
  free(path);
  ^

Signed-off-by: Boyan Ding <boyan.j.ding at gmail.com>
---
 src/libinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libinput.c b/src/libinput.c
index 5e616c8..56b93d6 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -1177,7 +1177,7 @@ xf86libinput_pre_init(InputDriverPtr drv,
 	struct xf86libinput *driver_data = NULL;
         struct libinput *libinput = NULL;
 	struct libinput_device *device;
-	char *path;
+	char *path = NULL;
 
 	pInfo->type_name = 0;
 	pInfo->device_control = xf86libinput_device_control;
-- 
2.3.0



More information about the xorg-devel mailing list