diff options
Diffstat (limited to 'src/plugins/spell')
-rw-r--r-- | src/plugins/spell/spell-command.c | 15 | ||||
-rw-r--r-- | src/plugins/spell/spell-speller.c | 9 | ||||
-rw-r--r-- | src/plugins/spell/spell.c | 19 |
3 files changed, 14 insertions, 29 deletions
diff --git a/src/plugins/spell/spell-command.c b/src/plugins/spell/spell-command.c index c41830bb8..4b78f4604 100644 --- a/src/plugins/spell/spell-command.c +++ b/src/plugins/spell/spell-command.c @@ -125,10 +125,8 @@ spell_enchant_dict_describe_cb (const char *lang_tag, weechat_printf (NULL, " %s", str_dict); } - if (lang) - free (lang); - if (country) - free (country); + free (lang); + free (country); } #endif /* USE_ENCHANT */ @@ -197,10 +195,8 @@ spell_command_speller_list_dicts () weechat_printf (NULL, " %s", str_dict); - if (lang) - free (lang); - if (country) - free (country); + free (lang); + free (country); } delete_aspell_dict_info_enumeration (elements); @@ -437,8 +433,7 @@ spell_command_cb (const void *pointer, void *data, dicts = weechat_string_replace (argv_eol[2], " ", ""); spell_command_set_dict (buffer, (dicts) ? dicts : argv[2]); - if (dicts) - free (dicts); + free (dicts); return WEECHAT_RC_OK; } diff --git a/src/plugins/spell/spell-speller.c b/src/plugins/spell/spell-speller.c index 007a4c570..5ae383126 100644 --- a/src/plugins/spell/spell-speller.c +++ b/src/plugins/spell/spell-speller.c @@ -446,12 +446,9 @@ spell_speller_buffer_free_value_cb (struct t_hashtable *hashtable, ptr_speller_buffer = (struct t_spell_speller_buffer *)value; - if (ptr_speller_buffer->spellers) - free (ptr_speller_buffer->spellers); - if (ptr_speller_buffer->modifier_string) - free (ptr_speller_buffer->modifier_string); - if (ptr_speller_buffer->modifier_result) - free (ptr_speller_buffer->modifier_result); + free (ptr_speller_buffer->spellers); + free (ptr_speller_buffer->modifier_string); + free (ptr_speller_buffer->modifier_result); free (ptr_speller_buffer); } diff --git a/src/plugins/spell/spell.c b/src/plugins/spell/spell.c index 51bf16526..c3ba10f35 100644 --- a/src/plugins/spell/spell.c +++ b/src/plugins/spell/spell.c @@ -216,10 +216,8 @@ spell_warning_aspell_config () spell_filename); } - if (aspell_filename) - free (aspell_filename); - if (spell_filename) - free (spell_filename); + free (aspell_filename); + free (spell_filename); } /* @@ -938,8 +936,7 @@ spell_modifier_cb (const void *pointer, void *data, * the beginning of this word, save the word (we will * look for suggestions after this loop) */ - if (misspelled_word) - free (misspelled_word); + free (misspelled_word); misspelled_word = strdup (ptr_string); } } @@ -1021,9 +1018,7 @@ spell_modifier_cb (const void *pointer, void *data, } } - if (old_misspelled_word) - free (old_misspelled_word); - + free (old_misspelled_word); free (misspelled_word); } else @@ -1046,8 +1041,7 @@ spell_modifier_cb (const void *pointer, void *data, (void) weechat_hook_signal_send ("spell_suggest", WEECHAT_HOOK_SIGNAL_POINTER, buffer); } - if (old_suggestions) - free (old_suggestions); + free (old_suggestions); ptr_speller_buffer->modifier_result = strdup (*result); @@ -1165,8 +1159,7 @@ spell_config_change_nick_completer_cb (const void *pointer, void *data, (void) data; (void) option; - if (spell_nick_completer) - free (spell_nick_completer); + free (spell_nick_completer); spell_nick_completer = weechat_string_strip (value, 0, 1, " "); spell_len_nick_completer = |