]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to reclaim tcp handler when it is closed due to dnscrypt buffer
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Aug 2017 13:40:44 +0000 (13:40 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Aug 2017 13:40:44 +0000 (13:40 +0000)
  allocation failure.

git-svn-id: file:///svn/unbound/trunk@4309 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/netevent.c

index 24747bdbfd61e12da9f630dc00aa132f1f98c7b4..e9f7eed3d169954f4a2e84d03ecb23e84a6a541c 100644 (file)
@@ -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
index 6990cdb36f3687bd71accd83c1d6356a1310a9de..771cb6bc7101344814661665829d6bbedc003bcb 100644 (file)
@@ -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;
                }
        }