summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/hostfile.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2006-03-19 02:23:27 +0000
committerDamien Miller <djm@cvs.openbsd.org>2006-03-19 02:23:27 +0000
commitcec517636d02b4dfff04a66d9ab20c655196987b (patch)
tree55f4d7c32f58130c2bb5e0a5c7e9d713445de6ed /usr.bin/ssh/hostfile.c
parent6b41cc007e50e8bc65a180e781f91841a3babc13 (diff)
FILE* leak detected by Coverity via elad AT netbsd.org;
ok deraadt@
Diffstat (limited to 'usr.bin/ssh/hostfile.c')
-rw-r--r--usr.bin/ssh/hostfile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/hostfile.c b/usr.bin/ssh/hostfile.c
index 5cb55dd3c7b..59d072f6b9b 100644
--- a/usr.bin/ssh/hostfile.c
+++ b/usr.bin/ssh/hostfile.c
@@ -36,7 +36,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: hostfile.c,v 1.37 2006/02/07 03:47:05 stevesk Exp $");
+RCSID("$OpenBSD: hostfile.c,v 1.38 2006/03/19 02:23:26 djm Exp $");
#include <resolv.h>
@@ -254,8 +254,10 @@ check_host_in_hostfile_by_key_or_type(const char *filename,
if (key == NULL) {
/* we found a key of the requested type */
- if (found->type == keytype)
+ if (found->type == keytype) {
+ fclose(f);
return HOST_FOUND;
+ }
continue;
}