From b99f0728ec7229423cfc65d25711208f6cac1c0e Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 10 Mar 2017 19:34:42 -0800 Subject: xwindow: use calloc in vwm_xwindow_create() Eliminate some initialization cruft. --- src/xwindow.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/xwindow.c b/src/xwindow.c index e22ca49..a01b212 100644 --- a/src/xwindow.c +++ b/src/xwindow.c @@ -136,19 +136,15 @@ vwm_xwindow_t * vwm_xwin_create(vwm_t *vwm, Window win, vwm_grab_mode_t grabbed) /* don't create InputOnly windows */ if (attrs.class == InputOnly) goto _out_grabbed; - if (!(xwin = (vwm_xwindow_t *)malloc(sizeof(vwm_xwindow_t)))) { + if (!(xwin = (vwm_xwindow_t *)calloc(1, sizeof(vwm_xwindow_t)))) { VWM_PERROR("Failed to allocate xwin"); goto _out_grabbed; } xwin->id = win; xwin->attrs = attrs; - xwin->managed = NULL; - xwin->name = NULL; XFetchName(VWM_XDISPLAY(vwm), win, &xwin->name); - xwin->monitor = NULL; - xwin->overlay.width = xwin->overlay.height = xwin->overlay.phase = 0; xwin->overlay.gen_last_composed = -1; /* This is so we get the PropertyNotify event and can get the pid when it's set post-create, -- cgit v1.2.3