From: Nick Mathewson Date: Mon, 9 Jan 2017 19:25:48 +0000 (-0500) Subject: Fix a memory leak found while fuzzing X-Git-Tag: tor-0.3.0.3-alpha~36^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a092bcdd4f619e9b08ebb09049b4dd6cbdb3ee1c;p=thirdparty%2Ftor.git Fix a memory leak found while fuzzing --- diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 0aa953cc52..8cdeb45b7f 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -3711,11 +3711,10 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, if (ns->type != NS_TYPE_CONSENSUS) { vote_routerstatus_t *rs = tor_malloc_zero(sizeof(vote_routerstatus_t)); if (routerstatus_parse_entry_from_string(rs_area, &s, rs_tokens, ns, - rs, 0, 0)) + rs, 0, 0)) { smartlist_add(ns->routerstatus_list, rs); - else { - tor_free(rs->version); - tor_free(rs); + } else { + vote_routerstatus_free(rs); } } else { routerstatus_t *rs;