commit a70d4584780ac40c71b5745b72c8a6e9d6aa964e
parent f25ae8ceb2f41d00aef4ae94b5e6cc2b3cb97f36
Author: wwp <subscript@free.fr>
Date: Mon, 27 Sep 2021 20:34:23 +0200
Fix CIS 1491270: resource leak.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gtk/spell_entry.c b/src/gtk/spell_entry.c
@@ -253,8 +253,11 @@ static gboolean word_misspelled(ClawsSpellEntry *entry, int start, int end)
gboolean ret;
word = get_word(entry, start, end);
- if (word == NULL || g_unichar_isdigit(word[0]))
+ if (word == NULL || g_unichar_isdigit(word[0])) {
+ if (word)
+ g_free(word);
return FALSE;
+ }
ret = gtkaspell_misspelled_test(entry->gtkaspell, word);