From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 05923377 for ; Thu, 7 Jan 2016 16:04:24 -0500 (EST) Date: Thu, 7 Jan 2016 16:04:24 -0500 (EST) Message-Id: <12989831251631287296.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: This code wasted memory by allocating sizeof(enum termfont *) X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- 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. Modified Files: -------------- mdocml: term.c Revision Data ------------- Index: term.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/term.c,v retrieving revision 1.255 retrieving revision 1.256 diff -Lterm.c -Lterm.c -u -p -r1.255 -r1.256 --- term.c +++ term.c @@ -365,7 +365,7 @@ term_fontpush(struct termp *p, enum term 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; } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv