Module Name: src Committed By: wiz Date: Wed Jan 5 00:19:20 UTC 2011
Modified Files: src/lib/librumpuser: rumpuser.c Log Message: Fix fdleak in error case. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/librumpuser/rumpuser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.10 src/lib/librumpuser/rumpuser.c:1.11 --- src/lib/librumpuser/rumpuser.c:1.10 Mon Nov 15 15:23:32 2010 +++ src/lib/librumpuser/rumpuser.c Wed Jan 5 00:19:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.10 2010/11/15 15:23:32 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.11 2011/01/05 00:19:20 wiz Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include <sys/cdefs.h> #if !defined(lint) -__RCSID("$NetBSD: rumpuser.c,v 1.10 2010/11/15 15:23:32 pooka Exp $"); +__RCSID("$NetBSD: rumpuser.c,v 1.11 2011/01/05 00:19:20 wiz Exp $"); #endif /* !lint */ /* thank the maker for this */ @@ -159,6 +159,7 @@ if (ioctl(fd, DIOCGDINFO, &lab) == -1) { seterror(errno); + (void)close(fd); rv = -1; goto out; }