aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-01-23 20:46:38 -0500
committerNick Mathewson <nickm@torproject.org>2010-01-23 20:46:38 -0500
commitaec4aea19045fa9fe1c80bd032bb97ad06bbf44e (patch)
tree2077be4f5e2bb2a8714b45bdd1ef2971b8ecbacf
parent4ad5094c9093f342a1f96fac7d90eb1781321e9a (diff)
downloadtor-aec4aea19045fa9fe1c80bd032bb97ad06bbf44e.tar
tor-aec4aea19045fa9fe1c80bd032bb97ad06bbf44e.tar.gz
Fix two rare leaks spotted by rieo.
-rw-r--r--src/or/router.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index dab4cb893..97f411dcd 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1384,6 +1384,7 @@ router_rebuild_descriptor(int force)
if (extrainfo_dump_to_string(ei->cache_info.signed_descriptor_body, 8192,
ei, get_identity_key()) < 0) {
log_warn(LD_BUG, "Couldn't generate extra-info descriptor.");
+ routerinfo_free(ri);
extrainfo_free(ei);
return -1;
}
@@ -1400,6 +1401,8 @@ router_rebuild_descriptor(int force)
if (router_dump_router_to_string(ri->cache_info.signed_descriptor_body, 8192,
ri, get_identity_key())<0) {
log_warn(LD_BUG, "Couldn't generate router descriptor.");
+ routerinfo_free(ri);
+ extrainfo_free(ei);
return -1;
}
ri->cache_info.signed_descriptor_len =
@@ -1885,6 +1888,7 @@ extrainfo_dump_to_string(char *s, size_t maxlen, extrainfo_t *extrainfo,
log_err(LD_BUG,
"We just generated an extrainfo descriptor we can't parse.");
log_err(LD_BUG, "Descriptor was: <<%s>>", s);
+ tor_free(s_dup);
return -1;
}
tor_free(s_dup);