Commit 61c3095

Anselm R Garbe <garbeam@gmail.com>
2009-07-08 11:05:36
die if malloc sizeof(Monitor) fails
1 parent a72dc2f
Changed files (1)
dwm.c
@@ -1693,7 +1693,8 @@ updategeom(void) {
 #endif /* XINERAMA */
 	/* allocate monitor(s) for the new geometry setup */
 	for(i = 0; i < n; i++) {
-		m = (Monitor *)malloc(sizeof(Monitor));
+		if(!(m = (Monitor *)malloc(sizeof(Monitor))))
+			die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));
 		m->next = newmons;
 		newmons = m;
 	}