From 2aac24deac03f334a1ea62c4eb1cea1c8f3c6010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 7 Oct 2024 11:24:10 +0200 Subject: [PATCH] clutter/actor: Steal instead of duplicating the last token value Instead of duplicating a string we own already we can just steal it from the array that we're using. This is safe since we're sure about the tokens GStrv length and we are always stealing the last element, so there is no risk that g_strfreev would eventually leak something. Part-of: --- clutter/clutter/clutter-actor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index dd4debbe1..5ac19c490 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -12029,7 +12029,7 @@ get_layout_from_animation_property (ClutterActor *actor, } if (name_p != NULL) - *name_p = g_strdup (tokens[1]); + *name_p = g_steal_pointer (&tokens[1]); return TRUE; } @@ -12060,7 +12060,7 @@ get_content_from_animation_property (ClutterActor *actor, } if (name_p != NULL) - *name_p = g_strdup (tokens[1]); + *name_p = g_steal_pointer (&tokens[1]); return TRUE; } @@ -12109,7 +12109,7 @@ get_meta_from_animation_property (ClutterActor *actor, meta = _clutter_meta_group_get_meta (priv->effects, tokens[1]); if (name_p != NULL) - *name_p = g_strdup (tokens[2]); + *name_p = g_steal_pointer (&tokens[2]); CLUTTER_NOTE (ANIMATION, "Looking for property '%s' of object '%s' in section '%s'",