diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-01-07 21:03:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-01-07 21:03:54 +0000 |
commit | 3888e737c349e3072adb67fd3bab4ef6509cf572 (patch) | |
tree | e37194d71d482c48c2e1b2a12e3c4e7e2fcb21dd | |
parent | b52337052ba14c502bdac85d23cebf68e8479ce5 (diff) | |
download | mandoc-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.
-rw-r--r-- | term.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |