From: Azat Khuzhin Date: Wed, 19 Aug 2015 10:22:49 +0000 (+0300) Subject: sample/https-client: don't try to free uninitialized SSL X-Git-Tag: release-2.1.6-beta~90^2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3d7ff5da26576391f884d506686cf032513c3d6;p=libevent 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); --- diff --git a/sample/https-client.c b/sample/https-client.c index 47e4595b..9d2c9e35 100644 --- a/sample/https-client.c +++ b/sample/https-client.c @@ -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();