malloc + memset -> zalloc

And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/clients/window.c b/clients/window.c
index ac35285..9ec9786 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1608,8 +1608,7 @@
 {
 	struct widget *widget;
 
-	widget = xmalloc(sizeof *widget);
-	memset(widget, 0, sizeof *widget);
+	widget = xzalloc(sizeof *widget);
 	widget->window = window;
 	widget->surface = surface;
 	widget->user_data = data;
@@ -2390,9 +2389,7 @@
 	struct frame_button *frame_button;
 	const char *icon = data;
 
-	frame_button = xmalloc(sizeof *frame_button);
-	memset(frame_button, 0, sizeof *frame_button);
-
+	frame_button = xzalloc (sizeof *frame_button);
 	frame_button->icon = cairo_image_surface_create_from_png(icon);
 	frame_button->widget = widget_add_widget(frame->widget, frame_button);
 	frame_button->frame = frame;
@@ -2621,9 +2618,7 @@
 {
 	struct frame *frame;
 
-	frame = xmalloc(sizeof *frame);
-	memset(frame, 0, sizeof *frame);
-
+	frame = xzalloc(sizeof *frame);
 	frame->widget = window_add_widget(window, frame);
 	frame->child = widget_add_widget(frame->widget, data);
 
@@ -4209,8 +4204,7 @@
 	struct window *window;
 	struct surface *surface;
 
-	window = xmalloc(sizeof *window);
-	memset(window, 0, sizeof *window);
+	window = xzalloc(sizeof *window);
 	wl_list_init(&window->subsurface_list);
 	window->display = display;
 	window->parent = parent;
@@ -4562,11 +4556,10 @@
 {
 	struct output *output;
 
-	output = malloc(sizeof *output);
+	output = zalloc(sizeof *output);
 	if (output == NULL)
 		return;
 
-	memset(output, 0, sizeof *output);
 	output->display = d;
 	output->scale = 1;
 	output->output =
@@ -4692,11 +4685,10 @@
 {
 	struct input *input;
 
-	input = malloc(sizeof *input);
+	input = zalloc(sizeof *input);
 	if (input == NULL)
 		return;
 
-	memset(input, 0, sizeof *input);
 	input->display = d;
 	input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, 1);
 	input->pointer_focus = NULL;
@@ -4998,12 +4990,10 @@
 
 	wl_log_set_handler_client(log_handler);
 
-	d = malloc(sizeof *d);
+	d = zalloc(sizeof *d);
 	if (d == NULL)
 		return NULL;
 
-        memset(d, 0, sizeof *d);
-
 	d->display = wl_display_connect(NULL);
 	if (d->display == NULL) {
 		fprintf(stderr, "failed to connect to Wayland display: %m\n");
@@ -5353,6 +5343,12 @@
 	return fail_on_null(malloc(s));
 }
 
+void *
+xzalloc(size_t s)
+{
+	return fail_on_null(zalloc(s));
+}
+
 char *
 xstrdup(const char *s)
 {