aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_pow_slow.c
diff options
context:
space:
mode:
authorMicah Elizabeth Scott <beth@torproject.org>2023-03-27 16:18:26 -0700
committerMicah Elizabeth Scott <beth@torproject.org>2023-05-10 07:38:29 -0700
commitac466a22195f8d550a8612bb89583c5e58eadb1a (patch)
tree47960d33a6d84f4011bc9b223f33c3310ae3e7d8 /src/test/test_hs_pow_slow.c
parentac29c7209dbdaf0d317f1c4eb67d5e330386552b (diff)
downloadtor-ac466a22195f8d550a8612bb89583c5e58eadb1a.tar.gz
tor-ac466a22195f8d550a8612bb89583c5e58eadb1a.zip
hs_pow: leak fix, free the contents of pqueue entries in hs_pow_free_service_state
Asan catches this pretty readily when ending a service gracefully while a DoS is in progress and the queue is full of items that haven't yet timed out. The module boundaries in hs_circuit are quite fuzzy here, but I'm trying to follow the vibe of the existing hs_pow code. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/test/test_hs_pow_slow.c')
-rw-r--r--src/test/test_hs_pow_slow.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/test_hs_pow_slow.c b/src/test/test_hs_pow_slow.c
index 690ce0cf78..fdade2d3fa 100644
--- a/src/test/test_hs_pow_slow.c
+++ b/src/test/test_hs_pow_slow.c
@@ -26,6 +26,7 @@ testing_one_hs_pow_solution(const hs_pow_solution_t *ref_solution,
int retval = -1;
hs_pow_solution_t sol_buffer;
hs_pow_service_state_t *s = tor_malloc_zero(sizeof(hs_pow_service_state_t));
+ s->rend_request_pqueue = smartlist_new();
memcpy(s->seed_previous, seed, HS_POW_SEED_LEN);