NetBSD-Bugs archive

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

bin/51478: Fix leak mem fsck_lfs/lfs.c



>Number:         51478
>Category:       bin
>Synopsis:       Fix leak mem fsck_lfs/lfs.c
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 15 23:05:00 +0000 2016
>Originator:     Jose Luis Rodriguez Garcia <joseyluis%gmail.com@localhost>
>Release:        current
>Organization:
	
>Environment:
>Description:
	In src/sbin/fsck_lfs/lfs.c lfs_raw_vget funtion, when it returns with NULL case doesn't free the memory allocated of: ip->i_din and ip->inode_ext.lfs
>How-To-Repeat:
	Code review
>Fix:
Index: lfs.c
===================================================================
RCS file: /cvsroot/src/sbin/fsck_lfs/lfs.c,v
retrieving revision 1.71
diff -u -r1.71 lfs.c
--- lfs.c	20 Mar 2016 04:24:46 -0000	1.71
+++ lfs.c	15 Sep 2016 21:42:58 -0000
@@ -376,6 +376,8 @@
 		dip = lfs_ifind(fs, ino, bp);
 		if (dip == NULL) {
 			brelse(bp, 0);
+			free(ip->i_din);
+			free(ip->inode_ext.lfs);
 			free(ip);
 			free(vp);
 			return NULL;



Home | Main Index | Thread Index | Old Index