summaryrefslogtreecommitdiff
path: root/fullscreen-shell
diff options
context:
space:
mode:
authorRyo Munakata <ryomnktml@gmail.com>2015-08-07 20:20:46 +0900
committerBryce Harrington <bryce@osg.samsung.com>2015-08-07 11:59:10 -0700
commit5e653caa4a45a313a968a6a52437c0c382dc8b34 (patch)
treedd1cf19d267da1fa3d1f738b37e0622ba04e9b2f /fullscreen-shell
parentb18f788e2e7476840eac54b0e7ac30a0244e4528 (diff)
downloadweston-5e653caa4a45a313a968a6a52437c0c382dc8b34.tar.gz
weston-5e653caa4a45a313a968a6a52437c0c382dc8b34.tar.bz2
weston-5e653caa4a45a313a968a6a52437c0c382dc8b34.zip
Use [x]zalloc instead of [x]malloc + memset
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'fullscreen-shell')
-rw-r--r--fullscreen-shell/fullscreen-shell.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fullscreen-shell/fullscreen-shell.c b/fullscreen-shell/fullscreen-shell.c
index ef9302bc..fa0bf8c7 100644
--- a/fullscreen-shell/fullscreen-shell.c
+++ b/fullscreen-shell/fullscreen-shell.c
@@ -142,10 +142,9 @@ seat_created(struct wl_listener *l, void *data)
struct weston_seat *seat = data;
struct pointer_focus_listener *listener;
- listener = malloc(sizeof *listener);
+ listener = zalloc(sizeof *listener);
if (!listener)
return;
- memset(listener, 0, sizeof *listener);
listener->shell = container_of(l, struct fullscreen_shell,
seat_created_listener);
@@ -251,10 +250,9 @@ fs_output_create(struct fullscreen_shell *shell, struct weston_output *output)
{
struct fs_output *fsout;
- fsout = malloc(sizeof *fsout);
+ fsout = zalloc(sizeof *fsout);
if (!fsout)
return NULL;
- memset(fsout, 0, sizeof *fsout);
fsout->shell = shell;
wl_list_insert(&shell->output_list, &fsout->link);
@@ -805,11 +803,10 @@ module_init(struct weston_compositor *compositor,
struct weston_seat *seat;
struct weston_output *output;
- shell = malloc(sizeof *shell);
+ shell = zalloc(sizeof *shell);
if (shell == NULL)
return -1;
- memset(shell, 0, sizeof *shell);
shell->compositor = compositor;
shell->client_destroyed.notify = client_destroyed;