summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/javascript/weechat-js-api.cpp11
-rw-r--r--src/plugins/javascript/weechat-js.cpp9
2 files changed, 6 insertions, 14 deletions
diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp
index c17fe046a..3cea774df 100644
--- a/src/plugins/javascript/weechat-js-api.cpp
+++ b/src/plugins/javascript/weechat-js-api.cpp
@@ -1216,9 +1216,7 @@ weechat_js_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);
}
}
@@ -1243,9 +1241,7 @@ weechat_js_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);
}
}
@@ -2864,8 +2860,7 @@ weechat_js_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;
}
diff --git a/src/plugins/javascript/weechat-js.cpp b/src/plugins/javascript/weechat-js.cpp
index 5ee9d0485..e545e0ac5 100644
--- a/src/plugins/javascript/weechat-js.cpp
+++ b/src/plugins/javascript/weechat-js.cpp
@@ -452,8 +452,7 @@ weechat_js_unload (struct t_plugin_script *script)
{
rc = (int *)weechat_js_exec (script, WEECHAT_SCRIPT_EXEC_INT,
script->shutdown_func, NULL, NULL);
- if (rc)
- free (rc);
+ free (rc);
}
filename = strdup (script->filename);
@@ -473,8 +472,7 @@ weechat_js_unload (struct t_plugin_script *script)
(void) weechat_hook_signal_send ("javascript_script_unloaded",
WEECHAT_HOOK_SIGNAL_STRING, filename);
- if (filename)
- free (filename);
+ free (filename);
}
/*
@@ -660,8 +658,7 @@ weechat_js_command_cb (const void *pointer, void *data,
ptr_name, 1);
weechat_js_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)
{