Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Nov 2009 10:53:46 +0000 (UTC)
From:      Alexander Leidinger <netchild@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r199860 - stable/8/sbin/fsck
Message-ID:  <200911271053.nARArkRL017716@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: netchild
Date: Fri Nov 27 10:53:46 2009
New Revision: 199860
URL: http://svn.freebsd.org/changeset/base/199860

Log:
  MFC r199582:
    Fix minor resource leak in a function which was introduced by changing an
    err() to a return in r106254.

Modified:
  stable/8/sbin/fsck/fsck.c
Directory Properties:
  stable/8/sbin/fsck/   (props changed)

Modified: stable/8/sbin/fsck/fsck.c
==============================================================================
--- stable/8/sbin/fsck/fsck.c	Fri Nov 27 07:55:39 2009	(r199859)
+++ stable/8/sbin/fsck/fsck.c	Fri Nov 27 10:53:46 2009	(r199860)
@@ -543,8 +543,10 @@ getfslab(const char *str)
 	if ((fd = open(str, O_RDONLY)) == -1)
 		err(1, "cannot open `%s'", str);
 
-	if (ioctl(fd, DIOCGDINFO, &dl) == -1)
+	if (ioctl(fd, DIOCGDINFO, &dl) == -1) {
+		(void) close(fd);
 		return(NULL);
+	}
 
 	(void) close(fd);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911271053.nARArkRL017716>