From f509578de5dd1f39bf5eed717f91be85c6a5f85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lestin=20Marot?= Date: Fri, 10 Dec 2021 17:36:30 +0100 Subject: [PATCH] multifilesrc: fix caps leak since `gst_caps_replace()` and `gst_pad_set_caps()` both ref the caps and neither of them takes the ownership of the caps -> it must be unreffed in `gst_multi_file_src_set_property()` to test the leak (on Unix): `echo coucou > /tmp/file.txt && GST_TRACERS=leaks GST_DEBUG="GST_TRACER:7" gst-launch-1.0 multifilesrc location=/tmp/file.txt caps='txt' ! fakesink` Part-of: --- subprojects/gst-plugins-good/gst/multifile/gstmultifilesrc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/gst-plugins-good/gst/multifile/gstmultifilesrc.c b/subprojects/gst-plugins-good/gst/multifile/gstmultifilesrc.c index b2fabc878e..48221b9ada 100644 --- a/subprojects/gst-plugins-good/gst/multifile/gstmultifilesrc.c +++ b/subprojects/gst-plugins-good/gst/multifile/gstmultifilesrc.c @@ -343,6 +343,7 @@ gst_multi_file_src_set_property (GObject * object, guint prop_id, src->fps_n = -1; src->fps_d = -1; } + gst_caps_unref (new_caps); } break; case PROP_LOOP: