Commit f9ad17fd authored by Claudio Saavedra's avatar Claudio Saavedra Committed by Carlos Garcia Campos

WebSockets: plug another leak in the send_message() method

The GByteArray allocated in the beginning is not freed in case
of error.
parent 72b88e89
Pipeline #110513 passed with stage
in 1 minute and 2 seconds
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment