- /* Create and initialize ws_win object. */
- if ((win = calloc(1, sizeof(struct ws_win))) == NULL)
- err(1, "manage_window: calloc: failed to allocate memory for "
- "new window");
+ if (!win) {
+ /* Create and initialize ws_win object. */
+ if ((win = calloc(1, sizeof(struct ws_win))) == NULL)
+ err(1, "manage_window: calloc: failed to allocate "
+ "memory for new window");