summaryrefslogtreecommitdiff
path: root/src/compositor-headless.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-08-08 11:57:05 +1000
committerKristian Høgsberg <krh@bitplanet.net>2013-08-08 13:46:13 -0700
commitf3d62276d20750e636fc82bc89b3c4c23576299d (patch)
tree05fee3d04531b3e3b303d82a546e26c1f1d96d81 /src/compositor-headless.c
parentb1bc4a68b0bc2d7b391c7484a52a46a636ad89fc (diff)
malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/compositor-headless.c')
-rw-r--r--src/compositor-headless.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/compositor-headless.c b/src/compositor-headless.c
index dd332422..4a0cc7fb 100644
--- a/src/compositor-headless.c
+++ b/src/compositor-headless.c
@@ -95,10 +95,9 @@ headless_compositor_create_output(struct headless_compositor *c,
struct headless_output *output;
struct wl_event_loop *loop;
- output = malloc(sizeof *output);
+ output = zalloc(sizeof *output);
if (output == NULL)
return -1;
- memset(output, 0, sizeof *output);
output->mode.flags =
WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
@@ -161,12 +160,10 @@ headless_compositor_create(struct wl_display *display,
{
struct headless_compositor *c;
- c = calloc(1, sizeof *c);
+ c = zalloc(sizeof *c);
if (c == NULL)
return NULL;
- memset(c, 0, sizeof *c);
-
if (weston_compositor_init(&c->base, display, argc, argv, config) < 0)
goto err_free;