summaryrefslogtreecommitdiff
path: root/src/plugins/php/weechat-php.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-04-24 23:38:23 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-04-25 20:59:24 +0200
commitc472b9a733e06f044a6bc7a502a9604c333b6fc7 (patch)
treef9c9121c8c47058ff1c5d4494cc589a5c66fd214 /src/plugins/php/weechat-php.c
parent0ac2e54b468dd011e9e5bd5b8a345a5d430eddee (diff)
downloadweechat-c472b9a733e06f044a6bc7a502a9604c333b6fc7.zip
php: remove check of NULL pointers before calling free() (issue #865)
Diffstat (limited to 'src/plugins/php/weechat-php.c')
-rw-r--r--src/plugins/php/weechat-php.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/php/weechat-php.c b/src/plugins/php/weechat-php.c
index 4c5dafd82..633f243c1 100644
--- a/src/plugins/php/weechat-php.c
+++ b/src/plugins/php/weechat-php.c
@@ -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)
{