Source-Changes-HG archive

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

[src/netbsd-1-5]: src/lib/libc/gen Pull up rev. 1.48 (approved by jhawk):



details:   https://anonhg.NetBSD.org/src/rev/3db675532b0e
branches:  netbsd-1-5
changeset: 489731:3db675532b0e
user:      enami <enami%NetBSD.org@localhost>
date:      Wed Oct 11 03:35:18 2000 +0000

description:
Pull up rev. 1.48 (approved by jhawk):
Reset allocated buffer size to 0 on allocation failure.

diffstat:

 lib/libc/gen/getpwent.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r b547dc698fb5 -r 3db675532b0e lib/libc/gen/getpwent.c
--- a/lib/libc/gen/getpwent.c   Tue Oct 10 14:05:22 2000 +0000
+++ b/lib/libc/gen/getpwent.c   Wed Oct 11 03:35:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getpwent.c,v 1.46.4.1 2000/10/02 20:11:25 simonb Exp $ */
+/*     $NetBSD: getpwent.c,v 1.46.4.2 2000/10/11 03:35:18 enami Exp $  */
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)getpwent.c 8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: getpwent.c,v 1.46.4.1 2000/10/02 20:11:25 simonb Exp $");
+__RCSID("$NetBSD: getpwent.c,v 1.46.4.2 2000/10/11 03:35:18 enami Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1191,6 +1191,7 @@
                if ((buf = realloc(buf, max)) == NULL) {
                        if (oldbuf != NULL)
                                free(oldbuf);
+                       max = 0;
                        return NS_UNAVAIL;
                }
        }



Home | Main Index | Thread Index | Old Index