From 7ab5a513926846a3e20ef12d2888c5d2aea501a6 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 25 Mar 2017 01:40:00 -0700 Subject: *: s/malloc/calloc/ Eliminate some 0/NULL initializations. --- src/desktop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/desktop.c') diff --git a/src/desktop.c b/src/desktop.c index 44c23f0..80f75f7 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -122,14 +122,13 @@ vwm_desktop_t * vwm_desktop_create(vwm_t *vwm, char *name) { vwm_desktop_t *desktop; - desktop = malloc(sizeof(vwm_desktop_t)); + desktop = calloc(1, sizeof(vwm_desktop_t)); if (desktop == NULL) { VWM_PERROR("Failed to allocate desktop"); goto _fail; } desktop->name = name == NULL ? name : strdup(name); - desktop->focused_window = NULL; list_add_tail(&desktop->desktops, &vwm->desktops); list_add_tail(&desktop->desktops_mru, &vwm->desktops_mru); -- cgit v1.2.3