From: Roger Dingledine Date: Sun, 9 Dec 2007 17:43:43 +0000 (+0000) Subject: fix a memory leak in authority_certs_fetch_missing() every time X-Git-Tag: tor-0.2.0.13-alpha~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be337eb0adf3f85397eaeabdfdf95a605f70970e;p=thirdparty%2Ftor.git fix a memory leak in authority_certs_fetch_missing() every time we try to call it but don't have enough dir info. svn:r12743 --- diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 47c780830b..141db022ac 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -311,13 +311,16 @@ authority_cert_get_by_digests(const char *id_digest, void authority_certs_fetch_missing(networkstatus_vote_t *status, time_t now) { - digestmap_t *pending = digestmap_new(); - smartlist_t *missing_digests = smartlist_create(); + digestmap_t *pending; + smartlist_t *missing_digests; char *resource = NULL; if (should_delay_dir_fetches(get_options())) return; + pending = digestmap_new(); + missing_digests = smartlist_create(); + list_pending_downloads(pending, DIR_PURPOSE_FETCH_CERTIFICATE, "fp/"); if (status) { SMARTLIST_FOREACH(status->voters, networkstatus_voter_info_t *, voter,