Source-Changes-HG archive

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

[src/netbsd-1-4]: src/libexec/lfs_cleanerd Pull up revision 1.8 (requested by...



details:   https://anonhg.NetBSD.org/src/rev/b6b4b09f7be6
branches:  netbsd-1-4
changeset: 470212:b6b4b09f7be6
user:      he <he%NetBSD.org@localhost>
date:      Mon Jan 31 19:06:29 2000 +0000

description:
Pull up revision 1.8 (requested by perseant):
  Fix a few memory leaks in lfs_cleanerd.

diffstat:

 libexec/lfs_cleanerd/print.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r e0e1b2c4512a -r b6b4b09f7be6 libexec/lfs_cleanerd/print.c
--- a/libexec/lfs_cleanerd/print.c      Mon Jan 31 19:06:12 2000 +0000
+++ b/libexec/lfs_cleanerd/print.c      Mon Jan 31 19:06:29 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: print.c,v 1.7 1999/03/10 00:57:16 perseant Exp $       */
+/*     $NetBSD: print.c,v 1.7.2.1 2000/01/31 19:06:29 he Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)print.c      8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: print.c,v 1.7 1999/03/10 00:57:16 perseant Exp $");
+__RCSID("$NetBSD: print.c,v 1.7.2.1 2000/01/31 19:06:29 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -83,10 +83,14 @@
 
        blk=0;
        datap = (u_long *)malloc((lfsp->lfs_ssize*lfsp->lfs_frag) * sizeof(u_long));
+       if(datap==NULL)
+               return(-1);
 
        if (sp->ss_sumsum != (ck = cksum(&sp->ss_datasum, 
-           LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum))))
+           LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum)))) {
+               free(datap);
                return(-1);
+       }
 
        if (flags & DUMP_SUM_HEADER) {
                 syslog(LOG_DEBUG, "    %s0x%X\t%s%d\t%s%d\n    %s0x%X\t%s0x%X",



Home | Main Index | Thread Index | Old Index