From: Florian Forster Date: Sun, 27 May 2012 09:10:56 +0000 (+0200) Subject: src/utils_avltree.c: Add sanity check to c_avl_destroy(). X-Git-Tag: collectd-5.0.5~7^2~14 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=da93b3172489e2eb51a93b0ab2238247a16c8e5b;p=collectd.git src/utils_avltree.c: Add sanity check to c_avl_destroy(). --- diff --git a/src/utils_avltree.c b/src/utils_avltree.c index 3e258e95..12310d3f 100644 --- a/src/utils_avltree.c +++ b/src/utils_avltree.c @@ -485,6 +485,8 @@ c_avl_tree_t *c_avl_create (int (*compare) (const void *, const void *)) void c_avl_destroy (c_avl_tree_t *t) { + if (t == NULL) + return; free_node (t->root); free (t); }