1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

charset: remove check of NULL pointers before calling free() (issue #865)

This commit is contained in:
Sébastien Helleu
2024-04-24 23:14:26 +02:00
parent c3750a02e3
commit f92606a317
+7 -14
View File
@@ -542,8 +542,7 @@ charset_command_cb (const void *pointer, void *data,
_("%s%s: wrong charset type (decode or encode "
"expected)"),
weechat_prefix ("error"), CHARSET_PLUGIN_NAME);
if (option_name)
free (option_name);
free (option_name);
return WEECHAT_RC_OK;
}
}
@@ -556,8 +555,7 @@ charset_command_cb (const void *pointer, void *data,
_("%s%s: invalid charset: \"%s\""),
weechat_prefix ("error"), CHARSET_PLUGIN_NAME,
ptr_charset);
if (option_name)
free (option_name);
free (option_name);
return WEECHAT_RC_OK;
}
if (ptr_section)
@@ -641,16 +639,11 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
weechat_config_free (charset_config_file);
charset_config_file = NULL;
if (charset_terminal)
{
free (charset_terminal);
charset_terminal = NULL;
}
if (charset_internal)
{
free (charset_internal);
charset_internal = NULL;
}
free (charset_terminal);
charset_terminal = NULL;
free (charset_internal);
charset_internal = NULL;
return WEECHAT_RC_OK;
}