From 2c96d15abeabb2042acb1069404f7c8fd576df97 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 10 Dec 2013 20:58:45 +0000 Subject: [PATCH] CID 1135779: Fix resource leak --- lib/libc/cdb/cdbr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libc/cdb/cdbr.c b/lib/libc/cdb/cdbr.c index 9de270418c30..4213524a1e8b 100644 --- a/lib/libc/cdb/cdbr.c +++ b/lib/libc/cdb/cdbr.c @@ -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 -__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; }