Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[glib] Plug memory leak. Fixes JB#34050
The leak was introduced by commit aec9288
  • Loading branch information
monich committed Jan 29, 2016
1 parent 9f89b56 commit cde56a1
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions rpm/gdbus-no-reply-expected.patch
@@ -1,8 +1,18 @@
diff --git a/gio/gdbusmethodinvocation.c b/gio/gdbusmethodinvocation.c
index c6cab91..26c04ee 100644
index c6cab91..35ab771 100644
--- a/gio/gdbusmethodinvocation.c
+++ b/gio/gdbusmethodinvocation.c
@@ -479,6 +479,9 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio
@@ -398,6 +398,9 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio
if (parameters == NULL)
parameters = g_variant_new_tuple (NULL, 0);

+ /* Make sure that we don't lose the reference, floating or not */
+ g_variant_ref_sink(parameters);
+
/* if we have introspection data, check that the signature of @parameters is correct */
if (invocation->method_info != NULL)
{
@@ -479,6 +482,9 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio
g_assert_not_reached ();
}

Expand All @@ -12,3 +22,11 @@ index c6cab91..26c04ee 100644
if (G_UNLIKELY (_g_dbus_debug_return ()))
{
_g_dbus_debug_print_lock ();
@@ -513,6 +519,7 @@ g_dbus_method_invocation_return_value_internal (GDBusMethodInvocation *invocatio
g_object_unref (reply);

out:
+ g_variant_unref(parameters);
g_object_unref (invocation);
}

0 comments on commit cde56a1

Please sign in to comment.