1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

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

This commit is contained in:
Sébastien Helleu
2024-04-25 00:06:08 +02:00
parent 590d9453a0
commit b56b34711d
5 changed files with 63 additions and 200 deletions
+2 -5
View File
@@ -67,9 +67,7 @@ plugin_api_charset_set (struct t_weechat_plugin *plugin, const char *charset)
if (!plugin || !charset)
return;
if (plugin->charset)
free (plugin->charset);
free (plugin->charset);
plugin->charset = (charset) ? strdup (charset) : NULL;
}
@@ -433,8 +431,7 @@ plugin_api_command_options (struct t_weechat_plugin *plugin,
split_newline,
delay);
if (command2)
free (command2);
free (command2);
return rc;
}