From 4dd352442892b4895572a70fe114ed41cb2c7264 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 7 Mar 2006 19:22:29 +0000 Subject: [PATCH] Free tree if we fail to allocate root node. svn path=/icecast/trunk/avl/; revision=10975 --- avl/avl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/avl/avl.c b/avl/avl.c index 5d01dce..7281e6c 100644 --- a/avl/avl.c +++ b/avl/avl.c @@ -70,6 +70,7 @@ avl_tree_new (avl_key_compare_fun_type compare_fun, } else { avl_node * root = avl_node_new((void *)NULL, (avl_node *) NULL); if (!root) { + free (t); return NULL; } else { t->root = root;