aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit3888e737c349e3072adb67fd3bab4ef6509cf572 (patch)
treee37194d71d482c48c2e1b2a12e3c4e7e2fcb21dd /term.c
parentb52337052ba14c502bdac85d23cebf68e8479ce5 (diff)
downloadmandoc-3888e737c349e3072adb67fd3bab4ef6509cf572.tar.gz
mandoc-3888e737c349e3072adb67fd3bab4ef6509cf572.tar.zst
mandoc-3888e737c349e3072adb67fd3bab4ef6509cf572.zip
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.c4
1 files changed, 2 insertions, 2 deletions
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 <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;
}