From: Wouter Wijngaards Date: Tue, 22 Aug 2017 13:40:44 +0000 (+0000) Subject: - Fix to reclaim tcp handler when it is closed due to dnscrypt buffer X-Git-Tag: release-1.6.6rc1~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ffc2f687cfa3084a44ebe37b028bc1282a89a9de;p=thirdparty%2Funbound.git - Fix to reclaim tcp handler when it is closed due to dnscrypt buffer allocation failure. git-svn-id: file:///svn/unbound/trunk@4309 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 24747bdbf..e9f7eed3d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,8 @@ 23 August 2017: Wouter - Fix #1407: Add ECS options check to unbound-checkconf. - make depend + - Fix to reclaim tcp handler when it is closed due to dnscrypt buffer + allocation failure. 22 August 2017: Wouter - Fix install of trust anchor when two anchors are present, makes both diff --git a/util/netevent.c b/util/netevent.c index 6990cdb36..771cb6bc7 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -1551,6 +1551,13 @@ comm_point_tcp_handle_callback(int fd, short event, void* arg) c->dnscrypt_buffer = sldns_buffer_new(sldns_buffer_capacity(c->buffer)); if(!c->dnscrypt_buffer) { log_err("Could not allocate dnscrypt buffer"); + reclaim_tcp_handler(c); + if(!c->tcp_do_close) { + fptr_ok(fptr_whitelist_comm_point( + c->callback)); + (void)(*c->callback)(c, c->cb_arg, + NETEVENT_CLOSED, NULL); + } return; } }