summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-04-09 13:08:12 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-04-09 13:08:12 +0200
commited2becf8fe4c35eb6b2b4c02e5df5fd5b824f6be (patch)
tree1358512e5a54a92cc1f3206f91a9470539ecc544 /src
parentf7c27b080183af02d86b039c65e6b1fc83fa4546 (diff)
downloadweechat-ed2becf8fe4c35eb6b2b4c02e5df5fd5b824f6be.zip
relay: free frames only if they were allocated by function relay_websocket_decode_frame
Diffstat (limited to 'src')
-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 "