From: Florian Forster Date: Fri, 17 Nov 2017 14:26:13 +0000 (+0100) Subject: src/utils_ovs.c: Unlock pdb->mutex before calling ovs_db_callback_remove_all(). X-Git-Tag: collectd-5.8.0~5^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=461a11ee1d46140244c79b4dff3b978426187f94;p=collectd.git src/utils_ovs.c: Unlock pdb->mutex before calling ovs_db_callback_remove_all(). CID: 179240 --- diff --git a/src/utils_ovs.c b/src/utils_ovs.c index 20873247..63cb94c4 100644 --- a/src/utils_ovs.c +++ b/src/utils_ovs.c @@ -1268,6 +1268,8 @@ int ovs_db_destroy(ovs_db_t *pdb) { ovs_db_ret = (-1); } + pthread_mutex_unlock(&pdb->mutex); + /* unsubscribe callbacks */ ovs_db_callback_remove_all(pdb); @@ -1276,7 +1278,6 @@ int ovs_db_destroy(ovs_db_t *pdb) { close(pdb->sock); /* release DB handler */ - pthread_mutex_unlock(&pdb->mutex); pthread_mutex_destroy(&pdb->mutex); sfree(pdb); return ovs_db_ret;