[PATCH weston 04/10] evdev: malloc + memset -> calloc

Peter Hutterer peter.hutterer at who-t.net
Tue Aug 6 18:04:43 PDT 2013


---
 src/evdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 96f3085..4f3f8cf 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -553,10 +553,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 = calloc(1, sizeof *device);
 	if (device == NULL)
 		return NULL;
-	memset(device, 0, sizeof *device);
 
 	ec = seat->compositor;
 	device->output =
-- 
1.8.2.1



More information about the wayland-devel mailing list