1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16:38 +02:00

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

This commit is contained in:
Sébastien Helleu
2024-04-24 23:36:22 +02:00
parent 3e994e3c5a
commit 0ac2e54b46
2 changed files with 8 additions and 18 deletions
+3 -8
View File
@@ -1278,9 +1278,7 @@ weechat_perl_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);
}
}
@@ -1305,9 +1303,7 @@ weechat_perl_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);
}
}
@@ -2979,8 +2975,7 @@ weechat_perl_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;
}
+5 -10
View File
@@ -709,8 +709,7 @@ weechat_perl_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);
@@ -736,14 +735,12 @@ weechat_perl_unload (struct t_plugin_script *script)
PERL_SET_CONTEXT (perl_current_script->interpreter);
}
#else
if (interpreter)
free (interpreter);
free (interpreter);
#endif /* MULTIPLICITY */
(void) weechat_hook_signal_send ("perl_script_unloaded",
WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
free (filename);
}
/*
@@ -859,8 +856,7 @@ weechat_perl_eval (struct t_gui_buffer *buffer, int send_to_buffer_as_input,
"script_perl_eval",
"s", func_argv);
/* result is ignored */
if (result)
free (result);
free (result);
weechat_perl_output_flush ();
@@ -966,8 +962,7 @@ weechat_perl_command_cb (const void *pointer, void *data,
ptr_name, 1);
weechat_perl_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)
{