]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
verify.c: Move fclose() to prevent overwrite of errno.
authorSimon Ruderich <simon@ruderich.org>
Sun, 28 Jul 2013 10:23:15 +0000 (12:23 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 28 Jul 2013 10:23:15 +0000 (12:23 +0200)
src/verify.c

index dfc6bfb2930c4f1f31dc2775bfb8cd600e50075d..e361e01b56c676c3ac32f9d4532e43c275e0632d 100644 (file)
@@ -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;