summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-04-03 09:52:07 +0200
committerSimon Josefsson <simon@josefsson.org>2008-04-03 09:53:42 +0200
commitb77f79d71b202cf7c8a8abfc62e56a9b47de3739 (patch)
tree800d8fe0d343f074fb342093e4b03dfca6ba9ad8
parentca2aa616df0fea797b573cc66e6ea9166a076551 (diff)
downloadgnutls-b77f79d71b202cf7c8a8abfc62e56a9b47de3739.tar.gz
(_gnutls_psk_pwd_find_entry): Call fclose after fopen.
Tiny patch from Laurence Withers <l@lwithers.me.uk>, see <http://lists.gnu.org/archive/html/gnutls-devel/2008-04/msg00002.html>.
-rw-r--r--lib/auth_psk_passwd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/auth_psk_passwd.c b/lib/auth_psk_passwd.c
index 82d1a9b635..c0a61f2039 100644
--- a/lib/auth_psk_passwd.c
+++ b/lib/auth_psk_passwd.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2007 Free Software Foundation
+ * Copyright (C) 2005, 2007, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
@@ -192,6 +192,7 @@ _gnutls_psk_pwd_find_entry (gnutls_session_t session, char *username,
if (strncmp (username, line, MAX (i, len)) == 0)
{
ret = pwd_put_values (psk, line);
+ fclose (fd);
if (ret < 0)
{
gnutls_assert ();
@@ -200,6 +201,7 @@ _gnutls_psk_pwd_find_entry (gnutls_session_t session, char *username,
return 0;
}
}
+ fclose (fd);
/* user was not found. Fake him.
* the last index found and randomize the entry.