From: Simon Josefsson Date: Thu, 3 Apr 2008 07:52:07 +0000 (+0200) Subject: (_gnutls_psk_pwd_find_entry): Call fclose after fopen. X-Git-Tag: gnutls_2_3_5~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4979c09c9c242bde4536fdcfe9fe5d1e8a7f0d0a;p=thirdparty%2Fgnutls.git (_gnutls_psk_pwd_find_entry): Call fclose after fopen. Tiny patch from Laurence Withers , see . --- diff --git a/lib/auth_psk_passwd.c b/lib/auth_psk_passwd.c index 0c3281d3e1..65891878c7 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 * @@ -197,6 +197,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 (); @@ -205,6 +206,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.