From: Peter Hutterer Date: Wed, 22 Jan 2014 01:01:24 +0000 (+1000) Subject: zalloc all events to make sure we have defined defaults X-Git-Tag: 0.1.0~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ef693825777bb40fa0336e4d716db420da2dfbc;p=platform%2Fupstream%2Flibinput.git zalloc all events to make sure we have defined defaults Signed-off-by: Peter Hutterer --- diff --git a/src/libinput.c b/src/libinput.c index 58bceef..ec86239 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -557,7 +557,7 @@ notify_added_device(struct libinput_device *device) { struct libinput_event_device_notify *added_device_event; - added_device_event = malloc(sizeof *added_device_event); + added_device_event = zalloc(sizeof *added_device_event); if (!added_device_event) return; @@ -575,7 +575,7 @@ notify_removed_device(struct libinput_device *device) { struct libinput_event_device_notify *removed_device_event; - removed_device_event = malloc(sizeof *removed_device_event); + removed_device_event = zalloc(sizeof *removed_device_event); if (!removed_device_event) return; @@ -596,7 +596,7 @@ keyboard_notify_key(struct libinput_device *device, { struct libinput_event_keyboard *key_event; - key_event = malloc(sizeof *key_event); + key_event = zalloc(sizeof *key_event); if (!key_event) return; @@ -619,7 +619,7 @@ pointer_notify_motion(struct libinput_device *device, { struct libinput_event_pointer *motion_event; - motion_event = malloc(sizeof *motion_event); + motion_event = zalloc(sizeof *motion_event); if (!motion_event) return; @@ -642,7 +642,7 @@ pointer_notify_motion_absolute(struct libinput_device *device, { struct libinput_event_pointer *motion_absolute_event; - motion_absolute_event = malloc(sizeof *motion_absolute_event); + motion_absolute_event = zalloc(sizeof *motion_absolute_event); if (!motion_absolute_event) return; @@ -665,7 +665,7 @@ pointer_notify_button(struct libinput_device *device, { struct libinput_event_pointer *button_event; - button_event = malloc(sizeof *button_event); + button_event = zalloc(sizeof *button_event); if (!button_event) return; @@ -688,7 +688,7 @@ pointer_notify_axis(struct libinput_device *device, { struct libinput_event_pointer *axis_event; - axis_event = malloc(sizeof *axis_event); + axis_event = zalloc(sizeof *axis_event); if (!axis_event) return; @@ -713,7 +713,7 @@ touch_notify_touch(struct libinput_device *device, { struct libinput_event_touch *touch_event; - touch_event = malloc(sizeof *touch_event); + touch_event = zalloc(sizeof *touch_event); if (!touch_event) return;