diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2019-08-30 19:27:35 +0300 |
---|---|---|
committer | Carlos Garcia Campos <carlos.gcampos@gmail.com> | 2019-09-02 08:01:10 +0000 |
commit | f9ad17fd4ec44073e16354ef2aaf10859fae9cbc (patch) | |
tree | b706627e41f6d472bee912b7de6be2060e8b5d13 /libsoup | |
parent | 72b88e896c498e59586cf327eb0734d863dbd9e0 (diff) | |
download | libsoup-f9ad17fd4ec44073e16354ef2aaf10859fae9cbc.tar.gz |
WebSockets: plug another leak in the send_message() method
The GByteArray allocated in the beginning is not freed in case
of error.
Diffstat (limited to 'libsoup')
-rw-r--r-- | libsoup/soup-websocket-connection.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c index 0d0ea34d..2c7fc116 100644 --- a/libsoup/soup-websocket-connection.c +++ b/libsoup/soup-websocket-connection.c @@ -492,6 +492,7 @@ send_message (SoupWebsocketConnection *self, extension = (SoupWebsocketExtension *)l->data; filtered_bytes = soup_websocket_extension_process_outgoing_message (extension, outer, filtered_bytes, &error); if (error) { + g_byte_array_free (bytes, TRUE); emit_error_and_close (self, error, FALSE); return; } @@ -505,6 +506,7 @@ send_message (SoupWebsocketConnection *self, if (length > 125) { g_warning ("WebSocket control message payload exceeds size limit"); protocol_error_and_close (self); + g_byte_array_free (bytes, TRUE); g_bytes_unref (filtered_bytes); return; } |