gst-inspect: Fix leak of plugin/feature

Reordering changes the initial list head

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7115>
This commit is contained in:
Edward Hervey 2024-06-29 17:12:12 +02:00 committed by GStreamer Marge Bot
parent 2c1c1ec575
commit 61a8d4d43d

View file

@ -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;