Fix : Free the iterator callback arrays
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 16 Oct 2012 18:24:15 +0000 (14:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 16 Oct 2012 18:24:15 +0000 (14:24 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/iterator.c

index 0ac041910f7aedf9d967600efd24e718318b6891..5b36d168c73aa3c38f30eac48884aa40a798a6a4 100644 (file)
@@ -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);
This page took 0.031927 seconds and 4 git commands to generate.