]> granicus.if.org Git - libevent/commitdiff
Free evdns_base->req_heads on evdns_base_free
authorNick Mathewson <nickm@torproject.org>
Sat, 13 Mar 2010 05:53:54 +0000 (00:53 -0500)
committerNick Mathewson <nickm@torproject.org>
Sat, 13 Mar 2010 05:53:54 +0000 (00:53 -0500)
It looks like when we moved from one big inflight-requests list to an
n-heads structure, we didn't make evdns_base_free() free the array of
heads.  This patch should fix that.

Found with valgrind

evdns.c

diff --git a/evdns.c b/evdns.c
index e9cbec76e978ac03bac69d2104423afce64cb62a..88d6fa378e9677dd736331bbd296cc6050700905 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -3775,6 +3775,8 @@ evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests)
                }
        }
 
+       mm_free(base->req_heads);
+
        EVDNS_UNLOCK(base);
        EVTHREAD_FREE_LOCK(base->lock, EVTHREAD_LOCKTYPE_RECURSIVE);