From 1d8437d6d5d187117896955d46865816ef086164 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 14 Nov 2019 16:32:34 -0500 Subject: [PATCH] src.ctf.fs: use ctf_fs_ds_index_destroy to free index The function ctf_fs_ds_file_group_destroy frees the ctf_fs_ds_index structure and its content by hand. Replace that with a call to ctf_fs_ds_index_destroy, which is meant for that. Change-Id: I186b1da9ec63cbdfa7ef7966d1e0e9802827e4f7 Signed-off-by: Simon Marchi --- src/plugins/ctf/fs-src/fs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c index 451e4116..d35b0111 100644 --- a/src/plugins/ctf/fs-src/fs.c +++ b/src/plugins/ctf/fs-src/fs.c @@ -560,12 +560,7 @@ void ctf_fs_ds_file_group_destroy(struct ctf_fs_ds_file_group *ds_file_group) g_ptr_array_free(ds_file_group->ds_file_infos, TRUE); } - if (ds_file_group->index) { - if (ds_file_group->index->entries) { - g_ptr_array_free(ds_file_group->index->entries, TRUE); - } - g_free(ds_file_group->index); - } + ctf_fs_ds_index_destroy(ds_file_group->index); bt_stream_put_ref(ds_file_group->stream); g_free(ds_file_group); -- 2.34.1