wpe: Plug a leak

We were freeing after returning

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
This commit is contained in:
Thibault Saunier 2021-05-21 10:13:01 -04:00
parent ca1812f38c
commit d93131bfee
2 changed files with 7 additions and 3 deletions

View file

@ -44,6 +44,7 @@ create_gerror_bus_msg (GstElement * element, GstMessage * message)
{ {
GError *error; GError *error;
gchar *debug_str, *details_structure, *src_path; gchar *debug_str, *details_structure, *src_path;
WebKitUserMessage *msg;
const GstStructure *details = NULL; const GstStructure *details = NULL;
if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) { if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) {
@ -60,7 +61,8 @@ create_gerror_bus_msg (GstElement * element, GstMessage * message)
details_structure = details_structure =
details ? gst_structure_to_string (details) : g_strdup (""); details ? gst_structure_to_string (details) : g_strdup ("");
src_path = gst_object_get_path_string (GST_MESSAGE_SRC (message)); 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) */ /* (message_type, src_path, error_domain, error_code, msg, debug_str, details_structure) */
g_variant_new ("(sssusss)", g_variant_new ("(sssusss)",
gst_message_type_get_name (GST_MESSAGE_TYPE (message)), 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) error->code, error->message, debug_str, details_structure)
); );
g_free (src_path); g_free (src_path);
return msg;
} }
/* Those types can't be deserialized on the receiver /* Those types can't be deserialized on the receiver