aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-12-12 02:07:59 -0500
committerNick Mathewson <nickm@torproject.org>2009-12-12 02:07:59 -0500
commit0c1b3070cfec670190636d74f97c2aaf0e521bdb (patch)
treeba893e6987f7b429510cec38a1cb6aaf0dc13793 /src/or/routerparse.c
parent79f72d0ef6cc3ce7cc92146ed0f0bdc7a4acad1a (diff)
downloadtor-0c1b3070cfec670190636d74f97c2aaf0e521bdb.tar.gz
tor-0c1b3070cfec670190636d74f97c2aaf0e521bdb.zip
Now that FOO_free(NULL) always works, remove checks before calling it.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 864056f44f..bc59a62b53 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1554,9 +1554,7 @@ router_parse_entry_from_string(const char *s, const char *end,
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens);
}
- if (exit_policy_tokens) {
- smartlist_free(exit_policy_tokens);
- }
+ smartlist_free(exit_policy_tokens);
if (area) {
DUMP_AREA(area, "routerinfo");
memarea_drop_all(area);
@@ -1672,8 +1670,7 @@ extrainfo_parse_entry_from_string(const char *s, const char *end,
goto done;
err:
dump_desc(s_dup, "extra-info descriptor");
- if (extrainfo)
- extrainfo_free(extrainfo);
+ extrainfo_free(extrainfo);
extrainfo = NULL;
done:
if (tokens) {
@@ -2316,8 +2313,7 @@ networkstatus_v2_parse_from_string(const char *s)
goto done;
err:
dump_desc(s_dup, "v2 networkstatus");
- if (ns)
- networkstatus_v2_free(ns);
+ networkstatus_v2_free(ns);
ns = NULL;
done:
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
@@ -2794,8 +2790,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
goto done;
err:
dump_desc(s_dup, "v3 networkstatus");
- if (ns)
- networkstatus_vote_free(ns);
+ networkstatus_vote_free(ns);
ns = NULL;
done:
if (tokens) {
@@ -3859,8 +3854,7 @@ microdescs_parse_from_string(const char *s, const char *eos,
md = NULL;
next:
- if (md)
- microdesc_free(md);
+ microdesc_free(md);
memarea_clear(area);
smartlist_clear(tokens);
@@ -4264,8 +4258,7 @@ rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out,
}
goto done;
err:
- if (result)
- rend_service_descriptor_free(result);
+ rend_service_descriptor_free(result);
result = NULL;
done:
if (tokens) {