From: Simon Ruderich Date: Sun, 28 Jul 2013 10:23:15 +0000 (+0200) Subject: verify.c: Move fclose() to prevent overwrite of errno. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=8a50081c2a92d1e91501cd74adb3f3472f2bea2b;p=tlsproxy%2Ftlsproxy.git verify.c: Move fclose() to prevent overwrite of errno. --- diff --git a/src/verify.c b/src/verify.c index dfc6bfb..e361e01 100644 --- a/src/verify.c +++ b/src/verify.c @@ -136,10 +136,10 @@ int verify_tls_connection(gnutls_session_t session, const char *hostname) { strcat(stored_cert, buffer); } if (ferror(file)) { - fclose(file); LOG(LOG_WARNING, "verify_tls_connection(): failed to read from '%s': %s", path, strerror(errno)); + fclose(file); LOG(LOG_DEBUG, "server certificate:\n%s", server_cert); return -1;