diff options
author | 2016-01-07 21:03:23 +0000 | |
---|---|---|
committer | 2016-01-07 21:03:23 +0000 | |
commit | 5d40c03b0a8a2ee6be6b5840fb7444b225518d29 (patch) | |
tree | 19b507054c9afc8417b9a74fb2f32afaa224681d | |
parent | Recursive "define" was not detected because "lim" was never (diff) | |
download | wireguard-openbsd-5d40c03b0a8a2ee6be6b5840fb7444b225518d29.tar.xz wireguard-openbsd-5d40c03b0a8a2ee6be6b5840fb7444b225518d29.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-- | usr.bin/mandoc/term.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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; } |