From: W.C.A. Wijngaards Date: Thu, 9 Jul 2020 12:06:21 +0000 (+0200) Subject: stream reuse, fix to return key pointer from reuse_tcp_by_id_find. X-Git-Tag: release-1.13.0rc1~5^2~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e44e8663d609c1b35f1f1cdf582b42d250f9414;p=thirdparty%2Funbound.git stream reuse, fix to return key pointer from reuse_tcp_by_id_find. --- diff --git a/services/outside_network.c b/services/outside_network.c index 07454d324..acfcb0853 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -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 */