mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 13:04:23 -04:00
https-client: do not try to free not initialized base
Otherwise: $ https-client --help Syntax: https-client -url <https-url> [-data data-file.bin] [-ignore-cert] [-retries num] [-timeout sec] [-crt crt] Example: https-client -url https://ip.appspot.com/ [warn] event_base_free_: no base to free (cherry picked from commit 428f36e5dd8f2a45ea5795fb9f35dd27a776e3a8)
This commit is contained in:
parent
5185347236
commit
c0adad8fe4
@ -45,7 +45,6 @@
|
||||
|
||||
#include "openssl_hostname_validation.h"
|
||||
|
||||
static struct event_base *base;
|
||||
static int ignore_cert = 0;
|
||||
|
||||
static void
|
||||
@ -188,7 +187,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int r;
|
||||
|
||||
struct event_base *base = NULL;
|
||||
struct evhttp_uri *http_uri = NULL;
|
||||
const char *url = NULL, *data_file = NULL;
|
||||
const char *crt = NULL;
|
||||
@ -483,7 +482,8 @@ cleanup:
|
||||
evhttp_connection_free(evcon);
|
||||
if (http_uri)
|
||||
evhttp_uri_free(http_uri);
|
||||
event_base_free(base);
|
||||
if (base)
|
||||
event_base_free(base);
|
||||
|
||||
if (ssl_ctx)
|
||||
SSL_CTX_free(ssl_ctx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user