X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_fbhash.c;h=7513729c679b29f4278395654a5f465c07e7ffe9;hb=924bfe28d5be1058ccf50931d77639212fb28346;hp=d20b7e39bdd453de1bdec5c4564ed30e994647a6;hpb=0ebe3efc7b797546bcae87a946cff1c4cf472919;p=collectd.git diff --git a/src/utils_fbhash.c b/src/utils_fbhash.c index d20b7e39..7513729c 100644 --- a/src/utils_fbhash.c +++ b/src/utils_fbhash.c @@ -36,7 +36,7 @@ struct fbhash_s c_avl_tree_t *tree; }; -/* +/* * Private functions */ static void fbh_free_tree (c_avl_tree_t *tree) /* {{{ */ @@ -193,7 +193,7 @@ static int fbh_check_file (fbhash_t *h) /* {{{ */ return (status); } /* }}} int fbh_check_file */ -/* +/* * Public functions */ fbhash_t *fbh_create (const char *file) /* {{{ */ @@ -223,6 +223,7 @@ fbhash_t *fbh_create (const char *file) /* {{{ */ if (status != 0) { fbh_destroy (h); + free (h); return (NULL); } @@ -234,6 +235,7 @@ void fbh_destroy (fbhash_t *h) /* {{{ */ if (h == NULL) return; + pthread_mutex_destroy (&h->lock); free (h->filename); fbh_free_tree (h->tree); } /* }}} void fbh_destroy */