diff options
author | Waldemar Zimpel <w.zimpel@dev.utilizer.de> | 2024-10-30 02:51:20 +0100 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2024-10-31 08:37:37 -0400 |
commit | 4759350b9a020d735506479e2d51c76d38566017 (patch) | |
tree | ec981c6e51ee8f27495ca3b22253dba5fd3ed89c /src/lib/evloop/workqueue.h | |
parent | 3abcb33545d66cc76893840decbcfd1159562d37 (diff) | |
download | tor-4759350b9a020d735506479e2d51c76d38566017.tar.gz tor-4759350b9a020d735506479e2d51c76d38566017.zip |
Fix: Use FREE_AND_NULL() for releasing workqueue resources
See issue #40989
Diffstat (limited to 'src/lib/evloop/workqueue.h')
-rw-r--r-- | src/lib/evloop/workqueue.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/evloop/workqueue.h b/src/lib/evloop/workqueue.h index 9ed504249a..cd892a14c8 100644 --- a/src/lib/evloop/workqueue.h +++ b/src/lib/evloop/workqueue.h @@ -58,7 +58,9 @@ threadpool_t *threadpool_new(int n_threads, void *(*new_thread_state_fn)(void*), void (*free_thread_state_fn)(void*), void *arg); -void threadpool_free(threadpool_t *tp); +void threadpool_free_(threadpool_t *tp); +#define threadpool_free(pool) \ + FREE_AND_NULL(threadpool_t, threadpool_free_, (pool)) replyqueue_t *threadpool_get_replyqueue(threadpool_t *tp); replyqueue_t *replyqueue_new(uint32_t alertsocks_flags); |