Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 PR/44235: Valeriy E. Ushakov: Don't pick...



details:   https://anonhg.NetBSD.org/src/rev/083969d07fe4
branches:  trunk
changeset: 760909:083969d07fe4
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 17 03:04:10 2011 +0000

description:
PR/44235: Valeriy E. Ushakov: Don't pick up a block from the free list if
it is not big enough, allocate a new one. XXX: this is inefficient, but at
least it does not end up corrupting memory.

diffstat:

 usr.bin/xlint/lint1/mem1.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1920e025ea6b -r 083969d07fe4 usr.bin/xlint/lint1/mem1.c
--- a/usr.bin/xlint/lint1/mem1.c        Mon Jan 17 01:35:24 2011 +0000
+++ b/usr.bin/xlint/lint1/mem1.c        Mon Jan 17 03:04:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mem1.c,v 1.13 2009/08/05 19:08:28 wiz Exp $    */
+/*     $NetBSD: mem1.c,v 1.14 2011/01/17 03:04:10 christos Exp $       */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.13 2009/08/05 19:08:28 wiz Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.14 2011/01/17 03:04:10 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -194,7 +194,7 @@
 
        s = ALIGN(s);
        if ((mb = *mbp) == NULL || mb->nfree < s) {
-               if ((mb = frmblks) == NULL) {
+               if ((mb = frmblks) == NULL || mb->size < s) {
                        if (s > mblklen) {
                                t = mblklen;
                                mblklen = s;



Home | Main Index | Thread Index | Old Index