projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8913bc
)
utils_fbhash.c: fix resource leak on error
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 4 Dec 2015 21:02:29 +0000
(22:02 +0100)
committer
Florian Forster
<octo@collectd.org>
Sat, 5 Dec 2015 07:53:12 +0000
(08:53 +0100)
CID #38014
Signed-off-by: Florian Forster <octo@collectd.org>
src/utils_fbhash.c
patch
|
blob
|
history
diff --git
a/src/utils_fbhash.c
b/src/utils_fbhash.c
index
97f21a1
..
7513729
100644
(file)
--- 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);
}