diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-08-06 16:07:35 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-08-06 16:07:35 +0000 |
commit | 5703727c0c5b5917be3a184486e2073f77c71a25 (patch) | |
tree | a9702556e34b18313e10f2b9aa7b8a6adc1837ae | |
parent | e95ebabedd29bfd2dd5f6f0ec793360d68f4b628 (diff) | |
download | mandoc-5703727c0c5b5917be3a184486e2073f77c71a25.tar.gz |
IMPORTANT FIX: add missing braces around alloc failure conditional in
fuction-isation of PS_GROWBUF. Obviously the original commit was never
actually tested, as -Tps and -Tpdf errored out immediately.
-rw-r--r-- | term_ps.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -362,13 +362,17 @@ ps_growbuf(struct termp *p, size_t sz) if (sz < PS_BUFSLOP) sz = PS_BUFSLOP; + p->engine.ps.psmargsz += sz; - p->engine.ps.psmarg = realloc(p->engine.ps.psmarg, - p->engine.ps.psmargsz); - if (NULL == p->engine.ps.psmarg) + p->engine.ps.psmarg = realloc + (p->engine.ps.psmarg, + p->engine.ps.psmargsz); + + if (NULL == p->engine.ps.psmarg) { perror(NULL); exit(EXIT_FAILURE); + } } static double ps_hspan(const struct termp *, |