From: Ruben Kerkhof Date: Fri, 4 Dec 2015 21:02:29 +0000 (+0100) Subject: utils_fbhash.c: fix resource leak on error X-Git-Tag: collectd-5.5.1~31^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0156c3098b39c4b7996891ec8342ed9c3f6d4aaa;p=collectd.git utils_fbhash.c: fix resource leak on error CID #38014 Signed-off-by: Florian Forster --- diff --git a/src/utils_fbhash.c b/src/utils_fbhash.c index 97f21a1f..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); }