From: Florian Forster Date: Mon, 20 Nov 2017 09:50:51 +0000 (+0100) Subject: write_sensu plugin: Unlock mutex before destroying it. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2df359d8b9dd5762681bcdbee6a446e8de65d9ac;p=collectd.git write_sensu plugin: Unlock mutex before destroying it. CID: 179237 --- diff --git a/src/write_sensu.c b/src/write_sensu.c index 72ed6bc0..92f1743d 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -28,14 +28,15 @@ #include "collectd.h" +#include "common.h" +#include "plugin.h" +#include "utils_cache.h" + #include #include #include #include #include -#include "common.h" -#include "plugin.h" -#include "utils_cache.h" #include #define SENSU_HOST "localhost" @@ -998,7 +999,10 @@ static void sensu_free(void *p) /* {{{ */ sfree(host->separator); free_str_list(&(host->metric_handlers)); free_str_list(&(host->notification_handlers)); + + pthread_mutex_unlock(&host->lock); pthread_mutex_destroy(&host->lock); + sfree(host); } /* }}} void sensu_free */