]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
stream reuse, fix to return key pointer from reuse_tcp_by_id_find.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 9 Jul 2020 12:06:21 +0000 (14:06 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 9 Jul 2020 12:06:21 +0000 (14:06 +0200)
services/outside_network.c

index 07454d3242356488e7f8eac7bbf2823070d058ac..acfcb0853957afc86ea7adc7d59946fd96475183 100644 (file)
@@ -418,10 +418,13 @@ static struct waiting_tcp*
 reuse_tcp_by_id_find(struct reuse_tcp* reuse, uint16_t id)
 {
        struct waiting_tcp key_w;
+       rbnode_type* n;
        memset(&key_w, 0, sizeof(key_w));
        key_w.id_node.key = &key_w;
        key_w.id = id;
-       return (struct waiting_tcp*)rbtree_search(&reuse->tree_by_id, &key_w);
+       n = rbtree_search(&reuse->tree_by_id, &key_w);
+       if(!n) return NULL;
+       return (struct waiting_tcp*)n->key;
 }
 
 /** return ID value of rbnode in tree_by_id */