Module Name: src
Committed By: christos
Date: Tue Dec 10 20:58:45 UTC 2013
Modified Files:
src/lib/libc/cdb: cdbr.c
Log Message:
CID 1135779: Fix resource leak
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/cdb/cdbr.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/libc/cdb/cdbr.c
diff -u src/lib/libc/cdb/cdbr.c:1.5 src/lib/libc/cdb/cdbr.c:1.6
--- src/lib/libc/cdb/cdbr.c:1.5 Thu Dec 5 16:17:23 2013
+++ src/lib/libc/cdb/cdbr.c Tue Dec 10 15:58:45 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: cdbr.c,v 1.5 2013/12/05 21:17:23 joerg Exp $ */
+/* $NetBSD: cdbr.c,v 1.6 2013/12/10 20:58:45 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -36,7 +36,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: cdbr.c,v 1.5 2013/12/05 21:17:23 joerg Exp $");
+__RCSID("$NetBSD: cdbr.c,v 1.6 2013/12/10 20:58:45 christos Exp $");
#include "namespace.h"
@@ -119,6 +119,7 @@ cdbr_open(const char *path, int flags)
}
if (sb.st_size >= SSIZE_MAX) {
+ close(fd);
errno = EINVAL;
return NULL;
}