summaryrefslogtreecommitdiff
path: root/src/or/dirserv.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/dirserv.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/dirserv.c')
-rw-r--r--src/or/dirserv.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 3338cd7527..b7f67132e4 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2818,10 +2818,8 @@ generate_v2_networkstatus_opinion(void)
tor_free(status);
tor_free(hostname);
tor_free(identity_pkey);
- if (routers)
- smartlist_free(routers);
- if (omit_as_sybil)
- digestmap_free(omit_as_sybil, NULL);
+ smartlist_free(routers);
+ digestmap_free(omit_as_sybil, NULL);
return r;
}
@@ -3497,8 +3495,7 @@ connection_dirserv_add_networkstatus_bytes_to_outbuf(dir_connection_t *conn)
}
} else {
connection_dirserv_finish_spooling(conn);
- if (conn->fingerprint_stack)
- smartlist_free(conn->fingerprint_stack);
+ smartlist_free(conn->fingerprint_stack);
conn->fingerprint_stack = NULL;
return 0;
}
@@ -3545,13 +3542,10 @@ dirserv_free_all(void)
cached_dir_decref(the_v2_networkstatus);
cached_dir_decref(cached_directory);
clear_cached_dir(&cached_runningrouters);
- if (cached_v2_networkstatus) {
- digestmap_free(cached_v2_networkstatus, _free_cached_dir);
- cached_v2_networkstatus = NULL;
- }
- if (cached_consensuses) {
- strmap_free(cached_consensuses, _free_cached_dir);
- cached_consensuses = NULL;
- }
+
+ digestmap_free(cached_v2_networkstatus, _free_cached_dir);
+ cached_v2_networkstatus = NULL;
+ strmap_free(cached_consensuses, _free_cached_dir);
+ cached_consensuses = NULL;
}