1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

core: fix memory leak when removing script files

This commit is contained in:
Sébastien Helleu
2014-08-09 18:49:06 +02:00
parent fc71ce0d43
commit 4e43be6d2c
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -907,9 +907,16 @@ plugin_script_remove_file (struct t_weechat_plugin *weechat_plugin,
while (i < 2)
{
path_script = plugin_script_search_path (weechat_plugin, name);
/* script not found? */
/*
* 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);
break;
}
num_found++;
if (unlink (path_script) == 0)
{