summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2014-08-25 08:00:48 +0000
committerdoug <doug@openbsd.org>2014-08-25 08:00:48 +0000
commit996733b2a9e3bb599d3a1b25328fe566e09c44ed (patch)
treed4aa60f8bc0a99398778f16eef27fcff556b6999
parentDelete secret or secret-derived data with explicit_bzero. (diff)
downloadwireguard-openbsd-996733b2a9e3bb599d3a1b25328fe566e09c44ed.tar.xz
wireguard-openbsd-996733b2a9e3bb599d3a1b25328fe566e09c44ed.zip
Fix a few fd leaks in isakmpd.
The latter close is from a sweep of the tree looking for fdopen problems. While reviewing the patch, gerhard@ fixed another leak. ok gerhard@
-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 b009baf78ac..bd122a6ceb2 100644
--- a/sbin/isakmpd/ike_auth.c
+++ b/sbin/isakmpd/ike_auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ike_auth.c,v 1.111 2014/08/23 00:48:57 doug Exp $ */
+/* $OpenBSD: ike_auth.c,v 1.112 2014/08/25 08:00:48 doug Exp $ */
/* $EOM: ike_auth.c,v 1.59 2000/11/21 00:21:31 angelos Exp $ */
/*
@@ -301,12 +301,14 @@ ignorekeynote:
if (check_file_secrecy_fd(fd, keyfile, &fsize)) {
free(privkeyfile);
+ close(fd);
return 0;
}
if ((keyfp = fdopen(fd, "r")) == NULL) {
log_print("ike_auth_get_key: fdopen failed");
free(privkeyfile);
+ close(fd);
return 0;
}
#if SSLEAY_VERSION_NUMBER >= 0x00904100L