From c96971eebb661859c5440b299dcf22d7414c841b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 22 Sep 2023 22:58:51 +0200 Subject: [PATCH] script: only check if return value of plugin_script_search_path is NULL (issue #2019) --- src/plugins/plugin-script.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c index 142dd7c10..c9ac37be3 100644 --- a/src/plugins/plugin-script.c +++ b/src/plugins/plugin-script.c @@ -1152,16 +1152,8 @@ plugin_script_remove_file (struct t_weechat_plugin *weechat_plugin, while (i < 2) { path_script = plugin_script_search_path (weechat_plugin, name, 0); - /* - * script not found? (if path_script == name, that means the function - * above did not find the script) - */ - if (!path_script || (strcmp (path_script, name) == 0)) - { - if (path_script) - free (path_script); + if (!path_script) break; - } num_found++; if (unlink (path_script) == 0) {