From 3888e737c349e3072adb67fd3bab4ef6509cf572 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'term.c') diff --git a/term.c b/term.c index 493d8770..e9171013 100644 --- a/term.c +++ b/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.255 2015/10/23 14:50:58 schwarze Exp $ */ +/* $Id: term.c,v 1.256 2016/01/07 21:03:54 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -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 v1.2.3