From 97bfb8b6cb79e5d6dc51dba941936fd8e86e2eaf Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 3 Nov 2022 14:08:57 +0100 Subject: [PATCH] imagesequencesrc; Fix leaks * The path was leaked * The custom buffer was never freed Part-of: --- subprojects/gst-plugins-good/gst/multifile/gstimagesequencesrc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/multifile/gstimagesequencesrc.c b/subprojects/gst-plugins-good/gst/multifile/gstimagesequencesrc.c index ce289b7..90dc9ff 100644 --- a/subprojects/gst-plugins-good/gst/multifile/gstimagesequencesrc.c +++ b/subprojects/gst-plugins-good/gst/multifile/gstimagesequencesrc.c @@ -144,7 +144,7 @@ static gboolean gst_image_sequence_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, GError ** err) { - gchar *hostname = NULL, *location = NULL, *tmp; + gchar *hostname = NULL, *location = NULL, *path, *tmp; gboolean ret = FALSE; GstImageSequenceSrc *self = GST_IMAGE_SEQUENCE_SRC (handler); GstUri *ruri = gst_uri_from_string (uri); @@ -160,9 +160,11 @@ gst_image_sequence_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, LOCK (self); g_clear_pointer (&self->uri, gst_uri_unref); self->uri = ruri; - tmp = gst_filename_to_uri (gst_uri_get_path (ruri), err); + path = gst_uri_get_path (ruri); + tmp = gst_filename_to_uri (path, err); location = g_filename_from_uri (tmp, &hostname, err); g_free (tmp); + g_free (path); query = gst_uri_get_query_table (ruri); if (!location || (err != NULL && *err != NULL)) { GST_WARNING_OBJECT (self, "Invalid URI '%s' for imagesequencesrc: %s", uri, @@ -606,7 +608,7 @@ gst_image_sequence_src_create (GstPushSrc * src, GstBuffer ** buffer) if (!ret) goto handle_error; - buf = gst_buffer_new_wrapped_full (0, data, size, 0, size, NULL, g_free); + buf = gst_buffer_new_wrapped (data, size); if (!self->caps) { GstCaps *caps; -- 2.7.4