summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-10-20 08:42:53 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-10-21 07:51:51 +1000
commitbc91d337d7cf765fd23e47783a498e4b3b334f39 (patch)
tree4c441e49644ed23a6a70c7d84d084aab9609163e /src
parentc8d2293873d3f86e5cefffa5c51cfe423d09c948 (diff)
Fix potential NULL pointer dereferencing
Found by coverity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/xf86libinput.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index a3260ae..8ee6cbe 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -2968,10 +2968,12 @@ xf86libinput_pre_init(InputDriverPtr drv,
return Success;
fail:
- if (driver_data->valuators)
- valuator_mask_free(&driver_data->valuators);
- if (driver_data->valuators_unaccelerated)
- valuator_mask_free(&driver_data->valuators_unaccelerated);
+ if (driver_data) {
+ if (driver_data->valuators)
+ valuator_mask_free(&driver_data->valuators);
+ if (driver_data->valuators_unaccelerated)
+ valuator_mask_free(&driver_data->valuators_unaccelerated);
+ }
free(path);
if (shared_device)
xf86libinput_shared_unref(shared_device);