diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-03-24 17:11:01 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-03-24 17:11:01 +0100 |
commit | 51b90cbd53c9db6320206cd701465da682694233 (patch) | |
tree | 791078b7f6aba4f3f4d9bc18f7c7eecea2831a8a /src/plugins/irc | |
parent | de825c91520b44e4e2efe6a8f66738e5a5aaec2a (diff) | |
download | weechat-51b90cbd53c9db6320206cd701465da682694233.zip |
irc: first search the modelist item, then free it if found
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-mode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c index 307527dcf..b90aacfd5 100644 --- a/src/plugins/irc/irc-mode.c +++ b/src/plugins/irc/irc-mode.c @@ -327,6 +327,7 @@ irc_mode_channel_set (struct t_irc_server *server, int smart_filter; struct t_irc_nick *ptr_nick; struct t_irc_modelist *ptr_modelist; + struct t_irc_modelist_item *ptr_item; if (!server || !channel || !modes) return 0; @@ -481,8 +482,10 @@ irc_mode_channel_set (struct t_irc_server *server, } else if (set_flag == '-') { - irc_modelist_item_free (ptr_modelist, - irc_modelist_item_search (ptr_modelist, ptr_arg)); + ptr_item = irc_modelist_item_search (ptr_modelist, + ptr_arg); + if (ptr_item) + irc_modelist_item_free (ptr_modelist, ptr_item); } } } |