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/nested.c b/clients/nested.c
index ced0b98..aa4bf34 100644
--- a/clients/nested.c
+++ b/clients/nested.c
@@ -404,13 +404,12 @@
struct nested *nested = wl_resource_get_user_data(resource);
struct nested_surface *surface;
- surface = malloc(sizeof *surface);
+ surface = zalloc(sizeof *surface);
if (surface == NULL) {
wl_resource_post_no_memory(resource);
return;
}
- memset(surface, 0, sizeof *surface);
surface->nested = nested;
display_acquire_window_surface(nested->display,
@@ -568,10 +567,9 @@
{
struct nested *nested;
- nested = malloc(sizeof *nested);
+ nested = zalloc(sizeof *nested);
if (nested == NULL)
return nested;
- memset(nested, 0, sizeof *nested);
nested->window = window_create(display);
nested->widget = frame_create(nested->window, nested);