malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Kristian Høgsberg
parent
b1bc4a68b0
commit
f3d62276d2
+1
-2
@@ -232,11 +232,10 @@ module_init(struct weston_compositor *ec,
|
||||
struct weston_test *test;
|
||||
struct wl_event_loop *loop;
|
||||
|
||||
test = malloc(sizeof *test);
|
||||
test = zalloc(sizeof *test);
|
||||
if (test == NULL)
|
||||
return -1;
|
||||
|
||||
memset(test, 0, sizeof *test);
|
||||
test->compositor = ec;
|
||||
weston_layer_init(&test->layer, &ec->cursor_layer.link);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user