diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c index a8df077001..2af104733b 100644 --- a/src/or/consdiffmgr.c +++ b/src/or/consdiffmgr.c @@ -566,6 +566,7 @@ consdiffmgr_find_consensus(struct consensus_cache_entry_t **entry_out, consensus_flavor_t flavor, compress_method_t method) { + tor_assert(entry_out); tor_assert((int)flavor < N_CONSENSUS_FLAVORS); int pos = consensus_compression_method_pos(method); diff --git a/src/or/directory.c b/src/or/directory.c index d954c06262..ef74c0fed4 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3929,8 +3929,10 @@ parse_consensus_request(parsed_consensus_request_t *out, uint8_t diff_from[DIGEST256_LEN]; out->diff_from_digests = smartlist_new(); out->diff_only = 1; - if (!parse_one_diff_hash(diff_from, diff_hash_in_url, "URL", - "rejecting")) { + int ok = !parse_one_diff_hash(diff_from, diff_hash_in_url, "URL", + "rejecting"); + tor_free(diff_hash_in_url); + if (ok) { smartlist_add(out->diff_from_digests, tor_memdup(diff_from, DIGEST256_LEN)); } else {