Module Name: src
Committed By: wiz
Date: Tue Jan 4 23:31:30 UTC 2011
Modified Files:
src/sbin/ccdconfig: ccdconfig.c
Log Message:
Fix file descriptor leak. Found by cppcheck.
To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sbin/ccdconfig/ccdconfig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/ccdconfig/ccdconfig.c
diff -u src/sbin/ccdconfig/ccdconfig.c:1.49 src/sbin/ccdconfig/ccdconfig.c:1.50
--- src/sbin/ccdconfig/ccdconfig.c:1.49 Mon Mar 16 12:52:07 2009
+++ src/sbin/ccdconfig/ccdconfig.c Tue Jan 4 23:31:29 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ccdconfig.c,v 1.49 2009/03/16 12:52:07 lukem Exp $ */
+/* $NetBSD: ccdconfig.c,v 1.50 2011/01/04 23:31:29 wiz Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1996, 1997\
The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: ccdconfig.c,v 1.49 2009/03/16 12:52:07 lukem Exp $");
+__RCSID("$NetBSD: ccdconfig.c,v 1.50 2011/01/04 23:31:29 wiz Exp $");
#endif
#include <sys/param.h>
@@ -471,9 +471,11 @@
cp = "unknown";
}
warn("ioctl (%s): %s", cp, path);
+ (void)close(fd);
return (1);
}
+ (void)close(fd);
return (0);
}