From a8cf222cd0b8570a0edcd7bd3178be811e78261f Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sat, 29 Jun 2024 17:12:12 +0200 Subject: [PATCH] gst-inspect: Fix leak of plugin/feature Reordering changes the initial list head Part-of: --- subprojects/gstreamer/tools/gst-inspect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subprojects/gstreamer/tools/gst-inspect.c b/subprojects/gstreamer/tools/gst-inspect.c index 18b260b129..a413340196 100644 --- a/subprojects/gstreamer/tools/gst-inspect.c +++ b/subprojects/gstreamer/tools/gst-inspect.c @@ -1322,7 +1322,8 @@ print_element_list (gboolean print_all, gchar * ftypes) orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ()); if (sort_output == SORT_TYPE_NAME) - plugins = g_list_sort (plugins, gst_plugin_name_compare_func); + orig_plugins = plugins = + g_list_sort (plugins, gst_plugin_name_compare_func); while (plugins) { GList *features, *orig_features; GstPlugin *plugin; @@ -1340,7 +1341,8 @@ print_element_list (gboolean print_all, gchar * ftypes) gst_registry_get_feature_list_by_plugin (gst_registry_get (), gst_plugin_get_name (plugin)); if (sort_output == SORT_TYPE_NAME) - features = g_list_sort (features, gst_plugin_feature_name_compare_func); + orig_features = features = + g_list_sort (features, gst_plugin_feature_name_compare_func); while (features) { GstPluginFeature *feature;