diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-04-16 11:52:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-04-24 11:01:40 -0400 |
commit | 43d683e0ad46b7914ef0e629dc7b953fcdd1f411 (patch) | |
tree | e83d53acb47bda7b95824b8c529a73d446b68320 /src/or/consdiffmgr.c | |
parent | 831e656baa0e43925e106c6029a92866cec6ca74 (diff) | |
download | tor-43d683e0ad46b7914ef0e629dc7b953fcdd1f411.tar.gz tor-43d683e0ad46b7914ef0e629dc7b953fcdd1f411.zip |
Fix reference leak & handle leak in consensus_diff_worker_replyfn
Found by previous test.
Diffstat (limited to 'src/or/consdiffmgr.c')
-rw-r--r-- | src/or/consdiffmgr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c index 240fe6e2da..1c9c2a9932 100644 --- a/src/or/consdiffmgr.c +++ b/src/or/consdiffmgr.c @@ -1058,6 +1058,7 @@ consensus_diff_worker_replyfn(void *work_) job->bodylen_out); status = CDM_DIFF_PRESENT; handle = consensus_cache_entry_handle_new(ent); + consensus_cache_entry_decref(ent); } else { /* Failure! Nothing to do but complain */ log_warn(LD_DIRSERV, @@ -1069,6 +1070,9 @@ consensus_diff_worker_replyfn(void *work_) if (cache) cdm_diff_ht_set_status(flav, from_sha3, to_sha3, status, handle); + else + consensus_cache_entry_handle_free(handle); + consensus_diff_worker_job_free(job); } |