From: doug Date: Mon, 25 Aug 2014 08:00:48 +0000 (+0000) Subject: Fix a few fd leaks in isakmpd. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=996733b2a9e3bb599d3a1b25328fe566e09c44ed;p=openbsd 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@ --- 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