summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2009-07-08 16:05:36 +0100
committerAnselm R Garbe <garbeam@gmail.com>2009-07-08 16:05:36 +0100
commit61c3095f2f9b35a0b330b37c172daefae0278663 (patch)
tree7eefbaa68f321d28395d1f673ed293548e837cb6
parentapplied Mate's patch, added Mate to LICENSE (diff)
downloaddwm-61c3095f2f9b35a0b330b37c172daefae0278663.tar.gz
dwm-61c3095f2f9b35a0b330b37c172daefae0278663.zip
die if malloc sizeof(Monitor) fails
Diffstat (limited to '')
-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) {
1693#endif /* XINERAMA */ 1693#endif /* XINERAMA */
1694 /* allocate monitor(s) for the new geometry setup */ 1694 /* allocate monitor(s) for the new geometry setup */
1695 for(i = 0; i < n; i++) { 1695 for(i = 0; i < n; i++) {
1696 m = (Monitor *)malloc(sizeof(Monitor)); 1696 if(!(m = (Monitor *)malloc(sizeof(Monitor))))
1697 die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));
1697 m->next = newmons; 1698 m->next = newmons;
1698 newmons = m; 1699 newmons = m;
1699 } 1700 }