From 2212a44cc2535f76d259aa6e926ee0884465796a Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Sat, 1 Feb 2020 02:57:05 +0100 Subject: [PATCH] clutter/actor: Fix GValue leak when overwriting transition values When the 'initial'/'final' values of an existing transition were being overwritten, the GValues used in _clutter_actor_create_transition() were not being unset. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1033 --- clutter/clutter/clutter-actor.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index ebbd5303e..610741abc 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -19265,8 +19265,8 @@ _clutter_actor_create_transition (ClutterActor *actor, gboolean call_restore = FALSE; TransitionClosure *clos; va_list var_args; - GValue initial = G_VALUE_INIT; - GValue final = G_VALUE_INIT; + g_auto (GValue) initial = G_VALUE_INIT; + g_auto (GValue) final = G_VALUE_INIT; GType ptype; char *error; @@ -19315,7 +19315,6 @@ _clutter_actor_create_transition (ClutterActor *actor, if (error != NULL) { g_critical ("%s: %s", G_STRLOC, error); - g_value_unset (&initial); g_free (error); goto out; } @@ -19337,9 +19336,6 @@ _clutter_actor_create_transition (ClutterActor *actor, &final, pspec); - g_value_unset (&initial); - g_value_unset (&final); - goto out; } @@ -19387,9 +19383,6 @@ _clutter_actor_create_transition (ClutterActor *actor, /* the actor now owns the transition */ g_object_unref (res); - - g_value_unset (&initial); - g_value_unset (&final); } else {