diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-18 14:10:10 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-18 14:28:58 +0100 |
commit | 40339b288ac37ace539d9091e8a2878540f49273 (patch) | |
tree | 5570b3a5a48e8a4cee4daaa36bc002d93a392084 /src/plugins/relay/irc/relay-irc.c | |
parent | eb6cc0bc2afa96824667521d3405bd1c077a4690 (diff) | |
download | weechat-40339b288ac37ace539d9091e8a2878540f49273.zip |
api: return newly allocated string in functions string_tolower and string_toupper
Diffstat (limited to 'src/plugins/relay/irc/relay-irc.c')
-rw-r--r-- | src/plugins/relay/irc/relay-irc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 1526b1eb3..929ee569d 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -1330,7 +1330,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data) const char *irc_command, *str_num_params, *isupport, *pos_password; char str_time[128], str_signal[128], str_server_channel[256], *nick; char str_param[128], *str_args, *version, str_command[128], **params; - char *pos, *password, *irc_is_channel, *info, *error; + char *pos, *password, *irc_is_channel, *info, *error, *str_cmd_lower; long num_params; int i, redirect_msg; @@ -1766,11 +1766,15 @@ relay_irc_recv (struct t_relay_client *client, const char *data) redirect_msg = 1; snprintf (str_command, sizeof (str_command), "%s", irc_command); - weechat_string_tolower (str_command); - weechat_hashtable_set (hash_redirect, "pattern", - str_command); - weechat_hashtable_set (hash_redirect, "string", - params[0]); + str_cmd_lower = weechat_string_tolower (str_command); + if (str_cmd_lower) + { + weechat_hashtable_set (hash_redirect, "pattern", + str_cmd_lower); + weechat_hashtable_set (hash_redirect, "string", + params[0]); + free (str_cmd_lower); + } } } else if (weechat_strcasecmp (irc_command, "time") == 0) |