about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--dwm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dwm.c b/dwm.c
index c0a15cc..267659f 100644
--- a/dwm.c
+++ b/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;
 	}
href='/akkartik/mu/blame/subx/build_and_test_until?h=hlt&id=1f4d0aaf08c117a0d6b56afd776066c336522f8b'>^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18