summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/relay/relay-client.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c
index 7b627d6fd..78966f039 100644
--- a/src/plugins/relay/relay-client.c
+++ b/src/plugins/relay/relay-client.c
@@ -663,12 +663,15 @@ relay_client_recv_buffer (struct t_relay_client *client,
if (!rc)
{
/* fatal error when decoding frame: close connection */
- for (i = 0; i < num_frames; i++)
+ if (frames)
{
- if (frames[i].payload)
- free (frames[i].payload);
+ for (i = 0; i < num_frames; i++)
+ {
+ if (frames[i].payload)
+ free (frames[i].payload);
+ }
+ free (frames);
}
- free (frames);
weechat_printf_date_tags (
NULL, 0, "relay_client",
_("%s%s: error decoding websocket frame for client "