summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-21 11:01:44 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-21 11:22:42 -0400
commit059e33de59030b008193512b58a51be922fffea4 (patch)
tree99a0d1e1e7c3cca85078e2aa0fa1ec013d907bb5 /src/or/dirvote.c
parent917e1042f75e9db2836def41210fa756c8ca3a85 (diff)
downloadtor-059e33de59030b008193512b58a51be922fffea4.tar.gz
tor-059e33de59030b008193512b58a51be922fffea4.zip
remove meaningless checks for chunks==NULL in dirserv stuff
Also, make it clearer that chunks cannot be NULL [CID 1031750, 1031751]
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 30f132115b..6536b7fe99 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -64,7 +64,7 @@ STATIC char *
format_networkstatus_vote(crypto_pk_t *private_signing_key,
networkstatus_t *v3_ns)
{
- smartlist_t *chunks;
+ smartlist_t *chunks = smartlist_new();
const char *client_versions = NULL, *server_versions = NULL;
char fingerprint[FINGERPRINT_LEN+1];
char digest[DIGEST_LEN];
@@ -98,7 +98,6 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
server_versions_line = tor_strdup("");
}
- chunks = smartlist_new();
{
char published[ISO_TIME_LEN+1];
char va[ISO_TIME_LEN+1];
@@ -230,10 +229,9 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
done:
tor_free(client_versions_line);
tor_free(server_versions_line);
- if (chunks) {
- SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp));
- smartlist_free(chunks);
- }
+
+ SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp));
+ smartlist_free(chunks);
return status;
}