From 0156c3098b39c4b7996891ec8342ed9c3f6d4aaa Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 4 Dec 2015 22:02:29 +0100 Subject: [PATCH] utils_fbhash.c: fix resource leak on error CID #38014 Signed-off-by: Florian Forster --- src/utils_fbhash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 2.11.0