1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 16:53:14 +02:00

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

This commit is contained in:
Sébastien Helleu
2024-04-24 23:38:23 +02:00
parent 0ac2e54b46
commit c472b9a733
2 changed files with 5 additions and 10 deletions
+2 -4
View File
@@ -214,8 +214,7 @@ weechat_php_cb (const void *pointer, void *data, void **func_argv,
if (ret_type == WEECHAT_SCRIPT_EXEC_IGNORE)
{
if (ret)
free (ret);
free (ret);
}
else if (ret_type == WEECHAT_SCRIPT_EXEC_INT)
{
@@ -235,8 +234,7 @@ weechat_php_cb (const void *pointer, void *data, void **func_argv,
weechat_php_cb_err:
if (ret_type == WEECHAT_SCRIPT_EXEC_IGNORE)
{
if (ret)
free (ret);
free (ret);
}
else if (ret_type == WEECHAT_SCRIPT_EXEC_INT)
{
+3 -6
View File
@@ -747,8 +747,7 @@ weechat_php_unload (struct t_plugin_script *script)
WEECHAT_SCRIPT_EXEC_INT,
script->shutdown_func,
NULL, NULL);
if (rc)
free (rc);
free (rc);
}
filename = strdup (script->filename);
@@ -761,8 +760,7 @@ weechat_php_unload (struct t_plugin_script *script)
(void) weechat_hook_signal_send ("php_script_unloaded",
WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
free (filename);
}
/*
@@ -948,8 +946,7 @@ weechat_php_command_cb (const void *pointer, void *data,
ptr_name, 1);
weechat_php_load ((path_script) ? path_script : ptr_name,
NULL);
if (path_script)
free (path_script);
free (path_script);
}
else if (weechat_strcmp (argv[1], "reload") == 0)
{