From f3d7ff5da26576391f884d506686cf032513c3d6 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 19 Aug 2015 13:22:49 +0300 Subject: [PATCH] sample/https-client: don't try to free uninitialized SSL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sample/https-client.c:459:3: warning: ‘ssl’ may be used uninitialized in this function [-Wmaybe-uninitialized] SSL_free(ssl); --- sample/https-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();