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:
Azat Khuzhin 2019-04-03 23:22:54 +03:00
parent 5185347236
commit c0adad8fe4
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -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,6 +482,7 @@ cleanup:
evhttp_connection_free(evcon);
if (http_uri)
evhttp_uri_free(http_uri);
if (base)
event_base_free(base);
if (ssl_ctx)