]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix for #411, #439, #469: stream reuse, fix loop in the free
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Fri, 23 Jul 2021 16:25:06 +0000 (18:25 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Fri, 23 Jul 2021 16:25:06 +0000 (18:25 +0200)
  pending_tcp list.

services/outside_network.c

index 023e094205f52598e8b83bf8f4805316a8877b73..54fcfdd5c6d3a5b9990778fe70f8747a7e51f5c8 100644 (file)
@@ -1032,8 +1032,12 @@ decommission_pending_tcp(struct outside_network* outnet,
        struct pending_tcp* pend)
 {
        verbose(VERB_CLIENT, "decommission_pending_tcp");
-       pend->next_free = outnet->tcp_free;
-       outnet->tcp_free = pend;
+       /* A certain code path can lead here twice for the same pending_tcp
+        * creating a loop in the free pending_tcp list. */
+       if(outnet->tcp_free != pend) {
+               pend->next_free = outnet->tcp_free;
+               outnet->tcp_free = pend;
+       }
        log_assert(outnet->tcp_free->next_free != outnet->tcp_free);
        if(pend->reuse.node.key) {
                /* needs unlink from the reuse tree to get deleted */