spurious memory leak (+364 bytes) removed during tcp timeout callback.

git-svn-id: file:///svn/unbound/trunk@577 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-09-03 09:45:18 +00:00
parent 8351afe61a
commit eb0deb1301
2 changed files with 9 additions and 2 deletions

View file

@ -3,6 +3,7 @@
validator. CNAME to a NXDOMAIN response was collated into a response
with both a CNAME and the NXDOMAIN rcode. Added a test that the
rcode is changed to NOERROR (because of the CNAME).
- timeout on tcp does not lead to spurious leakage detect.
31 August 2007: Wouter
- can read bind trusted-keys { ... }; files, in a compatibility mode.

View file

@ -173,8 +173,10 @@ use_free_buffer(struct outside_network* outnet)
if(outnet->tcp_wait_last == w)
outnet->tcp_wait_last = NULL;
if(!outnet_tcp_take_into_use(w, w->pkt, w->pkt_len)) {
(void)(*w->cb)(NULL, w->cb_arg, NETEVENT_CLOSED, NULL);
comm_point_callback_t* cb = w->cb;
void* cb_arg = w->cb_arg;
waiting_tcp_delete(w);
(void)(*cb)(NULL, cb_arg, NETEVENT_CLOSED, NULL);
}
}
}
@ -712,6 +714,8 @@ outnet_tcptimer(void* arg)
{
struct waiting_tcp* w = (struct waiting_tcp*)arg;
struct outside_network* outnet = w->outnet;
comm_point_callback_t* cb;
void* cb_arg;
if(w->pkt) {
/* it is on the waiting list */
struct waiting_tcp* p=outnet->tcp_wait_first, *prev=NULL;
@ -733,8 +737,10 @@ outnet_tcptimer(void* arg)
pend->next_free = outnet->tcp_free;
outnet->tcp_free = pend;
}
(void)(*w->cb)(NULL, w->cb_arg, NETEVENT_TIMEOUT, NULL);
cb = w->cb;
cb_arg = w->cb_arg;
waiting_tcp_delete(w);
(void)(*cb)(NULL, cb_arg, NETEVENT_TIMEOUT, NULL);
use_free_buffer(outnet);
}