mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-02 12:59:36 -05:00
Properly handle http_endpoint malloc failure.
This commit is contained in:
parent
39f6071854
commit
a3be2b73b6
1 changed files with 10 additions and 1 deletions
|
|
@ -3152,11 +3152,19 @@ comm_point_create_http_handler(struct comm_base *base,
|
|||
if(harden_large_queries && bufsize > 512)
|
||||
c->http2_stream_max_qbuffer_size = 512;
|
||||
c->http2_max_streams = http_max_streams;
|
||||
c->http_endpoint = strdup(http_endpoint);
|
||||
if(!(c->http_endpoint = strdup(http_endpoint))) {
|
||||
log_err("could not strdup http_endpoint");
|
||||
sldns_buffer_free(c->buffer);
|
||||
free(c->timeout);
|
||||
free(c->ev);
|
||||
free(c);
|
||||
return NULL;
|
||||
}
|
||||
c->alpn_h2 = 0;
|
||||
#ifdef HAVE_NGHTTP2
|
||||
if(!(c->h2_session = http2_session_create(c))) {
|
||||
log_err("could not create http2 session");
|
||||
free(c->http_endpoint);
|
||||
sldns_buffer_free(c->buffer);
|
||||
free(c->timeout);
|
||||
free(c->ev);
|
||||
|
|
@ -3166,6 +3174,7 @@ comm_point_create_http_handler(struct comm_base *base,
|
|||
if(!(c->h2_session->callbacks = http2_req_callbacks_create())) {
|
||||
log_err("could not create http2 callbacks");
|
||||
http2_session_delete(c->h2_session);
|
||||
free(c->http_endpoint);
|
||||
sldns_buffer_free(c->buffer);
|
||||
free(c->timeout);
|
||||
free(c->ev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue