diff options
author | Edward Hervey <edward@centricular.com> | 2022-11-30 09:59:09 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2022-12-01 06:42:22 +0000 |
commit | 0841e846a3aff41670aeb7ee5406116075c8dba3 (patch) | |
tree | a4a6f80814c847042b716fc08d6b55341fbcb149 | |
parent | 8f96453b0f94202262b721ec3b5e413f1fd26391 (diff) | |
download | gstreamer-0841e846a3aff41670aeb7ee5406116075c8dba3.tar.gz |
gst-inspect: Don't leak list
Just iterate the list instead of trying to be smart...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3497>
-rw-r--r-- | subprojects/gstreamer/tools/gst-inspect.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/subprojects/gstreamer/tools/gst-inspect.c b/subprojects/gstreamer/tools/gst-inspect.c index 6d50d7b8f4..d8f42e98ab 100644 --- a/subprojects/gstreamer/tools/gst-inspect.c +++ b/subprojects/gstreamer/tools/gst-inspect.c @@ -808,7 +808,7 @@ gst_static_pad_compare_func (gconstpointer p1, gconstpointer p2) static void print_pad_templates_info (GstElement * element, GstElementFactory * factory) { - GList *pads; + GList *pads, *tmp; GstStaticPadTemplate *padtemplate; GstPadTemplate *tmpl; @@ -824,9 +824,9 @@ print_pad_templates_info (GstElement * element, GstElementFactory * factory) pads = g_list_copy ((GList *) gst_element_factory_get_static_pad_templates (factory)); pads = g_list_sort (pads, gst_static_pad_compare_func); - while (pads) { - padtemplate = (GstStaticPadTemplate *) (pads->data); - pads = g_list_next (pads); + + for (tmp = pads; tmp; tmp = tmp->next) { + padtemplate = (GstStaticPadTemplate *) (tmp->data); if (padtemplate->direction == GST_PAD_SRC) n_print ("%sSRC template%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR, @@ -883,7 +883,7 @@ print_pad_templates_info (GstElement * element, GstElementFactory * factory) pop_indent (); - if (pads != NULL) + if (tmp->next) n_print ("\n"); } g_list_free (pads); |