Fix memory leak on lookup failure
[openssl.git] / apps / s_client.c
index b3aedd20e7e43fb312c92136d3a3e3129865e6b3..4d2fa861a58c5d252bd84e24e5b44762920bb77d 100644 (file)
@@ -1889,8 +1889,7 @@ int s_client_main(int argc, char **argv)
             goto end;
         }
         /* By default the SNI should be the same as was set in the session */
-        if (!noservername && servername == NULL)
-        {
+        if (!noservername && servername == NULL) {
             const char *sni = SSL_SESSION_get0_hostname(sess);
 
             if (sni != NULL) {
@@ -2647,6 +2646,7 @@ int s_client_main(int argc, char **argv)
                 default:
                     BIO_printf(bio_err, "Error writing early data\n");
                     BIO_free(edfile);
+                    ERR_print_errors(bio_err);
                     goto shut;
                 }
             }