mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
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:
parent
24a1f25ab6
commit
f3d7ff5da2
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user