summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2004-05-26 22:17:59 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2004-05-26 22:17:59 +0000
commit6f60b171e46429d8f1e014a19a8c78d1e460ecdb (patch)
tree9013bfba6c107c47d267a87bbf454b62bb56dcfe /sbin
parent2fe0cc1e051459403c4c3cf5deadc4277c463e6c (diff)
do not leak fd on error path.
ok ho@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/ike_auth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/isakmpd/ike_auth.c b/sbin/isakmpd/ike_auth.c
index 560527b057c..51fa0a623da 100644
--- a/sbin/isakmpd/ike_auth.c
+++ b/sbin/isakmpd/ike_auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ike_auth.c,v 1.87 2004/05/23 18:17:55 hshoexer Exp $ */
+/* $OpenBSD: ike_auth.c,v 1.88 2004/05/26 22:17:58 hshoexer Exp $ */
/* $EOM: ike_auth.c,v 1.59 2000/11/21 00:21:31 angelos Exp $ */
/*
@@ -234,6 +234,7 @@ ike_auth_get_key(int type, char *id, char *local_id, size_t *keylen)
log_print("ike_auth_get_key: failed allocating"
" %lu bytes", (unsigned long)size + 1);
free(keyfile);
+ close(fd);
return 0;
}
if (read(fd, buf, size) != (ssize_t) size) {
@@ -242,6 +243,7 @@ ike_auth_get_key(int type, char *id, char *local_id, size_t *keylen)
"failed reading %lu bytes from \"%s\"",
(unsigned long)size, keyfile);
free(keyfile);
+ close(fd);
return 0;
}
close(fd);