mirror of https://github.com/getdnsapi/getdns.git
Fix memory leak
This commit is contained in:
parent
5f6e47d091
commit
3eb6ebf5e4
|
@ -110,6 +110,9 @@ network_req_cleanup(getdns_network_req *net_req)
|
||||||
if (net_req->response && (net_req->response < net_req->wire_data ||
|
if (net_req->response && (net_req->response < net_req->wire_data ||
|
||||||
net_req->response > net_req->wire_data+ net_req->wire_data_sz))
|
net_req->response > net_req->wire_data+ net_req->wire_data_sz))
|
||||||
GETDNS_FREE(net_req->owner->my_mf, net_req->response);
|
GETDNS_FREE(net_req->owner->my_mf, net_req->response);
|
||||||
|
if (netreq->debug_tls_peer_cert.size &&
|
||||||
|
netreq->debug_tls_peer_cert.data)
|
||||||
|
OPENSSL_free(netreq->debug_tls_peer_cert.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t *
|
static uint8_t *
|
||||||
|
|
|
@ -1673,7 +1673,8 @@ upstream_write_cb(void *userarg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (netreq->upstream->tls_obj &&
|
if (netreq->owner->return_call_reporting &&
|
||||||
|
netreq->upstream->tls_obj &&
|
||||||
(cert = SSL_get_peer_certificate(netreq->upstream->tls_obj))) {
|
(cert = SSL_get_peer_certificate(netreq->upstream->tls_obj))) {
|
||||||
assert(netreq->debug_tls_peer_cert.data == NULL);
|
assert(netreq->debug_tls_peer_cert.data == NULL);
|
||||||
|
|
||||||
|
|
|
@ -912,7 +912,7 @@ _getdns_create_call_reporting_dict(
|
||||||
}
|
}
|
||||||
netreq->debug_tls_peer_cert.size = 0;
|
netreq->debug_tls_peer_cert.size = 0;
|
||||||
OPENSSL_free(netreq->debug_tls_peer_cert.data);
|
OPENSSL_free(netreq->debug_tls_peer_cert.data);
|
||||||
|
netreq->debug_tls_peer_cert.data = NULL;
|
||||||
return netreq_debug;
|
return netreq_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue