diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-30 18:43:24 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-30 18:43:24 +0000 |
commit | ea8cd0ee934ae86efb80393ca7b51e913e55043f (patch) | |
tree | bcb6bc3fb271ba628322b5e83d21979abc00ba5d /term.c | |
parent | e46c16c46ad18d40f21b251bf8995387efa68796 (diff) | |
download | mandoc-ea8cd0ee934ae86efb80393ca7b51e913e55043f.tar.gz |
Continued safe handling of allocations.
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -77,8 +77,11 @@ term_alloc(enum termenc enc) { struct termp *p; - if (NULL == (p = calloc(1, sizeof(struct termp)))) - return(NULL); + p = calloc(1, sizeof(struct termp)); + if (NULL == p) { + fprintf(stderr, "memory exhausted\n"); + exit(EXIT_FAILURE); + } p->maxrmargin = 78; p->enc = enc; return(p); |