diff options
author | Anselm R Garbe <garbeam@gmail.com> | 2009-07-08 16:05:36 +0100 |
---|---|---|
committer | Anselm R Garbe <garbeam@gmail.com> | 2009-07-08 16:05:36 +0100 |
commit | 61c3095f2f9b35a0b330b37c172daefae0278663 (patch) | |
tree | 7eefbaa68f321d28395d1f673ed293548e837cb6 /dwm.c | |
parent | a72dc2fec277bb517adcb98edfb18f469333d980 (diff) | |
download | dwm-61c3095f2f9b35a0b330b37c172daefae0278663.tar.gz |
die if malloc sizeof(Monitor) fails
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |