malloc + memset -> zalloc
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 8 Aug 2013 01:57:05 +0000 (11:57 +1000)
committerJonas Ådahl <jadahl@gmail.com>
Sun, 10 Nov 2013 16:51:32 +0000 (17:51 +0100)
And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev.c

index 5ad4d6b..e9fd809 100644 (file)
@@ -552,10 +552,9 @@ evdev_device_create(struct weston_seat *seat, const char *path, int device_fd)
        struct weston_compositor *ec;
        char devname[256] = "unknown";
 
-       device = malloc(sizeof *device);
+       device = zalloc(sizeof *device);
        if (device == NULL)
                return NULL;
-       memset(device, 0, sizeof *device);
 
        ec = seat->compositor;
        device->output =