From 74431f1f44da9cf48ed481218c13b8268a0acebb Mon Sep 17 00:00:00 2001 From: wiz Date: Tue, 4 Jan 2011 10:10:39 +0000 Subject: [PATCH] Fix fd leak in error case. Found by cppcheck. --- usr.sbin/sesd/srcs/sesd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/sesd/srcs/sesd.c b/usr.sbin/sesd/srcs/sesd.c index 7d3f08bfc1bd..00460f9d038b 100644 --- a/usr.sbin/sesd/srcs/sesd.c +++ b/usr.sbin/sesd/srcs/sesd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sesd.c,v 1.5 2009/04/18 13:57:44 lukem Exp $ */ +/* $NetBSD: sesd.c,v 1.6 2011/01/04 10:10:39 wiz Exp $ */ /* $FreeBSD: $ */ /* $OpenBSD: $ */ /* @@ -102,6 +102,7 @@ main(a, v) if (ioctl(fd, SESIOC_INIT, NULL) < 0) { fprintf(stderr, "%s: SESIOC_INIT fails- %s\n", v[dev], strerror(errno)); + (void) close(fd); return (1); } (void) close(fd);