Module Name:    src
Committed By:   christos
Date:           Mon Jan 17 03:04:10 UTC 2011

Modified Files:
        src/usr.bin/xlint/lint1: mem1.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/mem1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.13 src/usr.bin/xlint/lint1/mem1.c:1.14
--- src/usr.bin/xlint/lint1/mem1.c:1.13	Wed Aug  5 15:08:28 2009
+++ src/usr.bin/xlint/lint1/mem1.c	Sun Jan 16 22:04:10 2011
@@ -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;

Reply via email to