From 2f76be13cbe17cd57269943cfefe490accf2b1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20M=C3=ADchal?= Date: Wed, 18 Jun 2025 14:17:55 +0300 Subject: [PATCH] libgimpbase: Correctly free duplicate nicks in GimpChoice A crash could happen when a duplicate nick was found due to incorrectly freeing the content of 'choice->keys' which holds the nicks and not GimpChoiceDesc. Instead, the nick needs to be simply freed. --- libgimpbase/gimpchoice.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libgimpbase/gimpchoice.c b/libgimpbase/gimpchoice.c index 93d435dcaa..3dd72be158 100644 --- a/libgimpbase/gimpchoice.c +++ b/libgimpbase/gimpchoice.c @@ -204,8 +204,7 @@ gimp_choice_add (GimpChoice *choice, if (duplicate != NULL) { choice->keys = g_list_remove_link (choice->keys, duplicate); - gimp_choice_desc_free (duplicate->data); - g_list_free (duplicate); + g_free (duplicate->data); } choice->keys = g_list_append (choice->keys, g_strdup (nick)); }