diff options
author | Monsta <[email protected]> | 2014-11-22 19:11:28 +0300 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-19 13:56:36 +0100 |
commit | e5943056a8dac82b5dd2ed091290ca444ac554c8 (patch) | |
tree | bf7aec2725d3dd7459d5908f4218369d4eaa3bc9 /plugins/spell | |
parent | d01f58c9f78c07719c42d1973d57bc4f347481e7 (diff) | |
download | pluma-e5943056a8dac82b5dd2ed091290ca444ac554c8.tar.bz2 pluma-e5943056a8dac82b5dd2ed091290ca444ac554c8.tar.xz |
plugins: don't leak memory
Diffstat (limited to 'plugins/spell')
-rwxr-xr-x | plugins/spell/pluma-spell-checker-dialog.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/spell/pluma-spell-checker-dialog.c b/plugins/spell/pluma-spell-checker-dialog.c index a0d0b068..995d6853 100755 --- a/plugins/spell/pluma-spell-checker-dialog.c +++ b/plugins/spell/pluma-spell-checker-dialog.c @@ -636,15 +636,17 @@ ignore_all_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *d static void change_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { - gchar *word; + const gchar *entry_text; gchar *change; + gchar *word; g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (dlg->misspelled_word != NULL); - change = g_strdup (gtk_entry_get_text (GTK_ENTRY (dlg->word_entry))); - g_return_if_fail (change != NULL); - g_return_if_fail (*change != '\0'); + entry_text = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry)); + g_return_if_fail (entry_text != NULL); + g_return_if_fail (*entry_text != '\0'); + change = g_strdup (entry_text); pluma_spell_checker_set_correction (dlg->spell_checker, dlg->misspelled_word, -1, @@ -673,15 +675,17 @@ suggestions_list_row_activated_handler (GtkTreeView *view, static void change_all_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { - gchar *word; + const gchar *entry_text; gchar *change; + gchar *word; g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (dlg->misspelled_word != NULL); - change = g_strdup (gtk_entry_get_text (GTK_ENTRY (dlg->word_entry))); - g_return_if_fail (change != NULL); - g_return_if_fail (*change != '\0'); + entry_text = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry)); + g_return_if_fail (entry_text != NULL); + g_return_if_fail (*entry_text != '\0'); + change = g_strdup (entry_text); pluma_spell_checker_set_correction (dlg->spell_checker, dlg->misspelled_word, -1, |