diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-07-24 23:02:09 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-07-24 23:02:09 +0200 |
commit | 906ac1d1e16646503aa93720b4a00997200b9615 (patch) | |
tree | e181013f62f42a7668bd6bf7660f61d32d4108bb | |
parent | 2a145d7cc1d963e71d7df2210138b9f97de733e4 (diff) | |
download | weechat-906ac1d1e16646503aa93720b4a00997200b9615.zip |
relay: exit function relay_irc_recv if params can not be allocated
-rw-r--r-- | src/plugins/relay/irc/relay-irc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 06945159f..dbdc53702 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -1361,15 +1361,14 @@ relay_irc_recv (struct t_relay_client *client, const char *data) if (num_params > 0) { params = malloc ((num_params + 1) * sizeof (params[0])); - if (params) + if (!params) + goto end; + for (i = 0; i < num_params; i++) { - for (i = 0; i < num_params; i++) - { - snprintf (str_param, sizeof (str_param), "param%d", i + 1); - params[i] = weechat_hashtable_get (hash_parsed, str_param); - } - params[num_params] = NULL; + snprintf (str_param, sizeof (str_param), "param%d", i + 1); + params[i] = weechat_hashtable_get (hash_parsed, str_param); } + params[num_params] = NULL; } /* |