Projects
openEuler:24.03:SP1:Everything:64G
glib2
_service:tar_scm:backport-gdbusmessage-Clean-th...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-gdbusmessage-Clean-the-cached-arg0-when-setting-the-message-body.patch of Package glib2
From 8966099e9bef3fd3481f87bb7ad933f5cacad885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net> Date: Wed, 8 May 2024 22:53:51 +0200 Subject: [PATCH] gdbusmessage: Clean the cached arg0 when setting the message body We're now caching arg0 but such value is not cleared when a new body is set as it's in the connection filter test cases where we've a leak as highlighted by both valgrind and leak sanitizer --- gio/gdbusmessage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c index 0b77dc607..331e68d45 100644 --- a/gio/gdbusmessage.c +++ b/gio/gdbusmessage.c @@ -1167,10 +1167,12 @@ g_dbus_message_set_body (GDBusMessage *message, if (message->body != NULL) g_variant_unref (message->body); + + g_clear_pointer (&message->arg0_cache, g_variant_unref); + if (body == NULL) { message->body = NULL; - message->arg0_cache = NULL; g_dbus_message_set_signature (message, NULL); } else @@ -1184,8 +1186,6 @@ g_dbus_message_set_body (GDBusMessage *message, if (g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE) && g_variant_n_children (message->body) > 0) message->arg0_cache = g_variant_get_child_value (message->body, 0); - else - message->arg0_cache = NULL; type_string = g_variant_get_type_string (body); type_string_len = strlen (type_string); -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2