1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-08 18:53:12 +02:00

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

This commit is contained in:
Sébastien Helleu
2024-04-24 23:53:55 +02:00
parent 1f104d06a0
commit 0e3b6a9c77
2 changed files with 6 additions and 14 deletions
+3 -8
View File
@@ -1330,9 +1330,7 @@ weechat_tcl_api_config_option_change_cb (const void *pointer, void *data,
WEECHAT_SCRIPT_EXEC_IGNORE,
ptr_function,
"ss", func_argv);
if (rc)
free (rc);
free (rc);
}
}
@@ -1357,9 +1355,7 @@ weechat_tcl_api_config_option_delete_cb (const void *pointer, void *data,
WEECHAT_SCRIPT_EXEC_IGNORE,
ptr_function,
"ss", func_argv);
if (rc)
free (rc);
free (rc);
}
}
@@ -3060,8 +3056,7 @@ weechat_tcl_api_hook_print_cb (const void *pointer, void *data,
ret = *rc;
free (rc);
}
if (func_argv[3])
free (func_argv[3]);
free (func_argv[3]);
return ret;
}
+3 -6
View File
@@ -448,8 +448,7 @@ weechat_tcl_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);
@@ -465,8 +464,7 @@ weechat_tcl_unload (struct t_plugin_script *script)
(void) weechat_hook_signal_send ("tcl_script_unloaded",
WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
free (filename);
}
/*
@@ -652,8 +650,7 @@ weechat_tcl_command_cb (const void *pointer, void *data,
ptr_name, 1);
weechat_tcl_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)
{