mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
gdbusutils: Fix a memory leak in g_dbus_gvalue_to_gvariant()
g_variant_get_normal_form() doesn’t necessarily return a floating GVariant, so we have to take, rather than sink, the ref. This fixes a lot of leaks with gdbus-codegen-generated code. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=741167
This commit is contained in:
parent
d35d9b7911
commit
37d9b0c699
@ -685,7 +685,7 @@ g_dbus_gvalue_to_gvariant (const GValue *gvalue,
|
||||
{
|
||||
GVariant *untrusted_empty;
|
||||
untrusted_empty = g_variant_new_from_data (type, NULL, 0, FALSE, NULL, NULL);
|
||||
ret = g_variant_ref_sink (g_variant_get_normal_form (untrusted_empty));
|
||||
ret = g_variant_take_ref (g_variant_get_normal_form (untrusted_empty));
|
||||
g_variant_unref (untrusted_empty);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user