From: Nikos Mavrogiannopoulos Date: Sun, 4 May 2014 10:17:34 +0000 (+0200) Subject: Eliminated password file descriptor leak. X-Git-Tag: gnutls_3_3_2~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52d1bd7d845f7e9cecef8cbce2719c10d0010e87;p=thirdparty%2Fgnutls.git Eliminated password file descriptor leak. Issue discovered using codenomicon TLS test suite. --- diff --git a/lib/auth/psk_passwd.c b/lib/auth/psk_passwd.c index c553b4a26b..5c10997ba9 100644 --- a/lib/auth/psk_passwd.c +++ b/lib/auth/psk_passwd.c @@ -185,17 +185,16 @@ _gnutls_psk_pwd_find_entry(gnutls_session_t session, char *username, ret = GNUTLS_E_SRP_PWD_ERROR; goto cleanup; } - return 0; + ret = 0; + goto cleanup; } } /* user was not found. Fake him. - * the last index found and randomize the entry. */ ret = _randomize_psk(psk); if (ret < 0) { goto cleanup; - return ret; } ret = 0;