X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=util.c;fp=util.c;h=b4b163a280f13a5ba6f40b260c8b628963647e04;hb=5fd7af18c6b24bffd4701156feffcbc0db3b1d69;hp=d0444c552d68202d20ff8d8fe4514cd71abe8691;hpb=02238725f6b580ea8b6356377e359f933c5ca720;p=dmenu.git diff --git a/util.c b/util.c index d0444c5..b4b163a 100644 --- a/util.c +++ b/util.c @@ -1,5 +1,4 @@ -/* - * (C)opyright MMVI Anselm R. Garbe +/* (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. */ #include "dmenu.h" @@ -22,6 +21,7 @@ badmalloc(unsigned int size) { void * emalloc(unsigned int size) { void *res = malloc(size); + if(!res) badmalloc(size); return res; @@ -40,6 +40,7 @@ eprint(const char *errstr, ...) { char * estrdup(const char *str) { void *res = strdup(str); + if(!res) badmalloc(strlen(str)); return res;