From d93131bfeeb231a15c8faa3e0c8d0ec37688d1c1 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 21 May 2021 10:13:01 -0400 Subject: [PATCH] wpe: Plug a leak We were freeing after returning Part-of: --- ext/wpe/gstwpesrcbin.cpp | 4 ++-- ext/wpe/wpe-extension/gstwpebusmsgforwarder.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/wpe/gstwpesrcbin.cpp b/ext/wpe/gstwpesrcbin.cpp index e29621b596..e9680b7579 100644 --- a/ext/wpe/gstwpesrcbin.cpp +++ b/ext/wpe/gstwpesrcbin.cpp @@ -169,7 +169,7 @@ G_DEFINE_TYPE_WITH_CODE (GstWpeSrc, gst_wpe_src, GST_TYPE_BIN, * GstWpeSrc!video * * Since: 1.20 - */ + */ static GstStaticPadTemplate video_src_factory = GST_STATIC_PAD_TEMPLATE ("video", GST_PAD_SRC, GST_PAD_SOMETIMES, GST_STATIC_CAPS ("video/x-raw(memory:GLMemory), " @@ -194,7 +194,7 @@ GST_STATIC_PAD_TEMPLATE ("video", GST_PAD_SRC, GST_PAD_SOMETIMES, * #GstPad. * * Since: 1.20 - */ + */ static GstStaticPadTemplate audio_src_factory = GST_STATIC_PAD_TEMPLATE ("audio_%u", GST_PAD_SRC, GST_PAD_SOMETIMES, GST_STATIC_CAPS ( \ diff --git a/ext/wpe/wpe-extension/gstwpebusmsgforwarder.c b/ext/wpe/wpe-extension/gstwpebusmsgforwarder.c index 2d82510052..b6b8b6ea75 100644 --- a/ext/wpe/wpe-extension/gstwpebusmsgforwarder.c +++ b/ext/wpe/wpe-extension/gstwpebusmsgforwarder.c @@ -44,6 +44,7 @@ create_gerror_bus_msg (GstElement * element, GstMessage * message) { GError *error; gchar *debug_str, *details_structure, *src_path; + WebKitUserMessage *msg; const GstStructure *details = NULL; if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) { @@ -60,7 +61,8 @@ create_gerror_bus_msg (GstElement * element, GstMessage * message) details_structure = details ? gst_structure_to_string (details) : g_strdup (""); src_path = gst_object_get_path_string (GST_MESSAGE_SRC (message)); - return webkit_user_message_new ("gstwpe.bus_gerror_message", + + msg = webkit_user_message_new ("gstwpe.bus_gerror_message", /* (message_type, src_path, error_domain, error_code, msg, debug_str, details_structure) */ g_variant_new ("(sssusss)", gst_message_type_get_name (GST_MESSAGE_TYPE (message)), @@ -69,6 +71,8 @@ create_gerror_bus_msg (GstElement * element, GstMessage * message) error->code, error->message, debug_str, details_structure) ); g_free (src_path); + + return msg; } /* Those types can't be deserialized on the receiver