diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-03-19 10:17:32 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-03-19 10:17:32 +0100 |
commit | 872ff1cc6d542f9eb74083116f96582e409b7e7c (patch) | |
tree | 3b2ecdcc5aba916c2ca2e532167bb9d2c3caf7f9 /src | |
parent | 8123cb3e0b1d390531cec20c7808f473b0d4a6d3 (diff) | |
download | weechat-872ff1cc6d542f9eb74083116f96582e409b7e7c.zip |
irc: fix memory leak in command /autojoin addraw when channels are missing
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-command.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 9f1aa1d34..d0dca1d1f 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -958,7 +958,12 @@ IRC_COMMAND_CALLBACK(autojoin) /* add raw channel(s) */ if (weechat_strcasecmp (argv[1], "addraw") == 0) { - WEECHAT_COMMAND_MIN_ARGS(3, "addraw"); + if (argc < 3) + { + if (old_autojoin) + free (old_autojoin); + WEECHAT_COMMAND_MIN_ARGS(3, "addraw"); + } irc_join_add_channels_to_autojoin (ptr_server, argv_eol[2]); goto end; } |