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.
This commit is contained in:
parent
06d8bd6c54
commit
2f76be13cb
1 changed files with 1 additions and 2 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue