Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst A malloc() return value wasn't checked...



details:   https://anonhg.NetBSD.org/src/rev/b116227e1d22
branches:  trunk
changeset: 533413:b116227e1d22
user:      scottr <scottr%NetBSD.org@localhost>
date:      Sat Jun 29 20:04:56 2002 +0000

description:
A malloc() return value wasn't checked properly in cleanup_dist() while
reading the file list. Bob Nestor found this by inspection while working on
sysinst for NetBSD/mac68k, and as such there is no corresponding PR.

diffstat:

 distrib/utils/sysinst/util.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 20c87e69230f -r b116227e1d22 distrib/utils/sysinst/util.c
--- a/distrib/utils/sysinst/util.c      Sat Jun 29 19:47:02 2002 +0000
+++ b/distrib/utils/sysinst/util.c      Sat Jun 29 20:04:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.71 2002/06/06 09:53:22 lukem Exp $  */
+/*     $NetBSD: util.c,v 1.72 2002/06/29 20:04:56 scottr Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -614,7 +614,7 @@
                        }
                } else {
                        current->next = malloc(sizeof(struct filelist));
-                       if (head == NULL) {
+                       if (current->next == NULL) {
                                fprintf(stderr, "out of memory\n");
                                exit(1);
                        }



Home | Main Index | Thread Index | Old Index