From 6f60b171e46429d8f1e014a19a8c78d1e460ecdb Mon Sep 17 00:00:00 2001 From: Hans-Joerg Hoexer Date: Wed, 26 May 2004 22:17:59 +0000 Subject: do not leak fd on error path. ok ho@ --- sbin/isakmpd/ike_auth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sbin') 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); -- cgit v1.2.3