From 236465ac5ced2c3f58c52e38673d1f576a3599b0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 7 Jan 2016 21:03:24 +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. --- usr.bin/mandoc/term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/mandoc/term.c') 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 * Copyright (c) 2010-2015 Ingo Schwarze @@ -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; } -- cgit v1.2.3