From: Julien Desfossez Date: Tue, 16 Oct 2012 18:24:15 +0000 (-0400) Subject: Fix : Free the iterator callback arrays X-Git-Tag: v1.0.0-rc6~12 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=6743ae7d80368d451ba9c4583ae826dc76af0061;hp=e6d85e38ecef913abbb661e80ca91478bdd0113f Fix : Free the iterator callback arrays Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf/iterator.c b/formats/ctf/iterator.c index 0ac04191..5b36d168 100644 --- a/formats/ctf/iterator.c +++ b/formats/ctf/iterator.c @@ -47,7 +47,8 @@ struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx, g_free(iter); return NULL; } - iter->callbacks = g_array_new(0, 1, sizeof(struct bt_stream_callbacks)); + iter->callbacks = g_array_new(FALSE, TRUE, + sizeof(struct bt_stream_callbacks)); iter->recalculate_dep_graph = 0; iter->main_callbacks.callback = NULL; iter->dep_gc = g_ptr_array_new(); @@ -81,6 +82,8 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter) } g_array_free(bt_stream_cb->per_id_callbacks, TRUE); } + g_array_free(iter->callbacks, TRUE); + g_ptr_array_free(iter->dep_gc, TRUE); bt_iter_fini(&iter->parent); g_free(iter);