diff options
author | Tomasz Moń <desowin@gmail.com> | 2019-05-16 18:18:59 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-05-20 14:16:54 +0000 |
commit | 81cea3def7f184bb7901febc96c3f79e7bcf0b14 (patch) | |
tree | 975ba08734a3f52a50c94d29655e0a8e7fb01b92 /extcap.c | |
parent | c52776da62b562a9bc8dff4464b0ce33dcb3234e (diff) |
extcap: Do not free mutex and cond in thread_pool_wait()
The name does not suggest that variables are freed in any way. Free the
mutex and cond where they are initialized, ie. in extcap_run_all().
Change-Id: I4e2ffacd32a8ba74831682438baed52e714433bb
Reviewed-on: https://code.wireshark.org/review/33223
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'extcap.c')
-rw-r--r-- | extcap.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -147,9 +147,7 @@ thread_pool_wait(thread_pool_t *pool) while (pool->count != 0) { g_cond_wait(&pool->cond, &pool->data_mutex); } - g_cond_clear(&pool->cond); g_mutex_unlock(&pool->data_mutex); - g_mutex_clear(&pool->data_mutex); } static GHashTable * @@ -513,6 +511,9 @@ extcap_run_all(const char *argv[], extcap_run_cb_t output_cb, gsize data_size, g /* Wait for all (sub)tasks to complete. */ thread_pool_wait(&pool); + + g_mutex_clear(&pool.data_mutex); + g_cond_clear(&pool.cond); g_thread_pool_free(pool.pool, FALSE, TRUE); g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "extcap: completed discovery of %d tools in %.3fms", |