diff options
Diffstat (limited to 'src/common/tree.c')
-rw-r--r-- | src/common/tree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/tree.c b/src/common/tree.c index 587d15f0..b9a894d2 100644 --- a/src/common/tree.c +++ b/src/common/tree.c @@ -42,7 +42,7 @@ struct _tree tree * tree_new (tree_cmp_func *cmp, void *data) { - tree *t = calloc (1, sizeof (tree)); + tree *t = g_new0 (tree, 1); t->cmp = cmp; t->data = data; return t; @@ -53,9 +53,8 @@ tree_destroy (tree *t) { if (t) { - if (t->array) - free (t->array); - free (t); + g_free (t->array); + g_free (t); } } |