diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 112a4cc99..ca074a8c6 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -16,6 +16,7 @@ For a list of important changes that require manual actions, please look at rele Bug fixes:: * scripts: fix crash on script unload when a hook is created in a buffer close callback (issue #2067) + * trigger: fix memory leak when adding a new trigger with `/trigger` command [[v4.2.1]] == Version 4.2.1 (2024-01-22) diff --git a/src/plugins/trigger/trigger-command.c b/src/plugins/trigger/trigger-command.c index 46cc69c16..504697591 100644 --- a/src/plugins/trigger/trigger-command.c +++ b/src/plugins/trigger/trigger-command.c @@ -773,16 +773,6 @@ trigger_command_trigger (const void *pointer, void *data, goto end; } } - ptr_trigger = trigger_alloc (sargv[0]); - if (!ptr_trigger) - { - weechat_printf_date_tags ( - NULL, 0, "no_trigger", - _("%s%s: failed to create trigger \"%s\""), - weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, - sargv[0]); - goto end; - } ptr_trigger = trigger_new ( sargv[0], /* name */ (weechat_strcmp (argv[1], "addoff") == 0) ? "off" : "on",