From eb8a728a2ecb1ac5b786710c85f87504f32554f8 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 7 Jan 2016 21:03:54 +0000 Subject: 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. --- term.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'term.c') 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; } -- cgit