diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-01-07 21:03:24 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-01-07 21:03:24 +0000 |
commit | 236465ac5ced2c3f58c52e38673d1f576a3599b0 (patch) | |
tree | d8cd32debd44b6eecbbf6f4a4910a2e00226d4f9 /usr.bin/mandoc/term.c | |
parent | af9b9a58897bd4d744ef997d27aabae468075ee6 (diff) |
This code wasted memory by allocating sizeof(enum termfont *)
where only sizeof(enum termfont) is needed.
Fixes CID 1288941. From christos@ via wiz@, both at NetBSD.
Diffstat (limited to 'usr.bin/mandoc/term.c')
-rw-r--r-- | usr.bin/mandoc/term.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c index a0227a0cd99..d0cfa645343 100644 --- a/usr.bin/mandoc/term.c +++ b/usr.bin/mandoc/term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term.c,v 1.115 2015/10/23 14:49:13 schwarze Exp $ */ +/* $OpenBSD: term.c,v 1.116 2016/01/07 21:03:23 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -363,7 +363,7 @@ term_fontpush(struct termp *p, enum termfont f) if (++p->fonti == p->fontsz) { p->fontsz += 8; p->fontq = mandoc_reallocarray(p->fontq, - p->fontsz, sizeof(enum termfont *)); + p->fontsz, sizeof(*p->fontq)); } p->fontq[p->fonti] = f; } |