summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-01-09 14:25:48 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-30 08:37:26 -0500
commita092bcdd4f619e9b08ebb09049b4dd6cbdb3ee1c (patch)
tree31b93ad4c691fc0c519ce10aff77ea9a09597eda /src/or/routerparse.c
parent09d01466b2d35d762f0a4916bc39a3ceb11d87bc (diff)
downloadtor-a092bcdd4f619e9b08ebb09049b4dd6cbdb3ee1c.tar.gz
tor-a092bcdd4f619e9b08ebb09049b4dd6cbdb3ee1c.zip
Fix a memory leak found while fuzzing
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c7
1 files changed, 3 insertions, 4 deletions
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;