From 8a50081c2a92d1e91501cd74adb3f3472f2bea2b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 28 Jul 2013 12:23:15 +0200 Subject: [PATCH] verify.c: Move fclose() to prevent overwrite of errno. --- src/verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.45.2