summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-01-07 21:03:54 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-01-07 21:03:54 +0000
commiteb8a728a2ecb1ac5b786710c85f87504f32554f8 (patch)
treeeae28e9df9d027ff2f5eba1dbb49c2ac72d0ab03 /term.c
parent2a0a5838c9334e2e30548b44810b594c9cdbe106 (diff)
downloadmandoc-eb8a728a2ecb1ac5b786710c85f87504f32554f8.tar.gz
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 'term.c')
-rw-r--r--term.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/term.c b/term.c
index 1991c70f..4b264240 100644
--- a/term.c
+++ b/term.c
@@ -365,7 +365,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;
}