Module Name:    src
Committed By:   christos
Date:           Sat Feb  7 04:19:53 UTC 2015

Modified Files:
        src/sys/ufs/chfs: chfs_scan.c

Log Message:
fix buf leak. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/ufs/chfs/chfs_scan.c

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

Modified files:

Index: src/sys/ufs/chfs/chfs_scan.c
diff -u src/sys/ufs/chfs/chfs_scan.c:1.5 src/sys/ufs/chfs/chfs_scan.c:1.6
--- src/sys/ufs/chfs/chfs_scan.c:1.5	Mon Sep  1 12:27:38 2014
+++ src/sys/ufs/chfs/chfs_scan.c	Fri Feb  6 23:19:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_scan.c,v 1.5 2014/09/01 16:27:38 he Exp $	*/
+/*	$NetBSD: chfs_scan.c,v 1.6 2015/02/07 04:19:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -461,6 +461,7 @@ chfs_scan_eraseblock(struct chfs_mount *
 			read_free += CHFS_NODE_HDR_SIZE;
 			if (read_free >= MAX_READ_FREE(chmp)) {
 				dbg("rest of the block is free. Size: %d\n", cheb->free_size);
+				kmem_free(buf, CHFS_MAX_NODE_SIZE);
 				return chfs_scan_classify_cheb(chmp, cheb);
 			}
 			ofs += CHFS_NODE_HDR_SIZE;

Reply via email to