From 2e03d3799c0fa1c005fbfd9b6acc40d2101e5c99 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 30 Jan 2018 12:23:23 +0100 Subject: [PATCH] Memory leak on some TLS creation error cases --- src/stub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stub.c b/src/stub.c index 07f22fcd..a9ec8240 100644 --- a/src/stub.c +++ b/src/stub.c @@ -956,6 +956,7 @@ tls_create_object(getdns_dns_req *dnsreq, int fd, getdns_upstream *upstream) "%-40s : ERROR: Hostname Authentication not available from TLS library (check library version)\n", upstream->addr_str); upstream->tls_hs_state = GETDNS_HS_FAILED; + SSL_free(ssl); return NULL; } #endif @@ -973,6 +974,7 @@ tls_create_object(getdns_dns_req *dnsreq, int fd, getdns_upstream *upstream) DEBUG_STUB("%s %-35s: ERROR: No host name or pubkey pinset provided for TLS authentication\n", STUB_DEBUG_SETUP_TLS, __FUNC__); upstream->tls_hs_state = GETDNS_HS_FAILED; + SSL_free(ssl); return NULL; } } else {