sample/https-client: don't try to free uninitialized SSL

sample/https-client.c:459:3: warning: ‘ssl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   SSL_free(ssl);
This commit is contained in:
Azat Khuzhin 2015-08-19 13:22:49 +03:00
parent 24a1f25ab6
commit f3d7ff5da2

View File

@ -195,7 +195,7 @@ main(int argc, char **argv)
int retries = 0;
SSL_CTX *ssl_ctx = NULL;
SSL *ssl;
SSL *ssl = NULL;
struct bufferevent *bev;
struct evhttp_connection *evcon = NULL;
struct evhttp_request *req;
@ -455,7 +455,7 @@ cleanup:
if (ssl_ctx)
SSL_CTX_free(ssl_ctx);
if (type == HTTP)
if (type == HTTP && ssl)
SSL_free(ssl);
EVP_cleanup();
ERR_free_strings();