[libsoup/websockets-fixes-2.66: 17/19] WebSockets: plug another leak in the send_message() method




commit 4f27b63db1ef5e043d8a1073b272bfdc96971ebc
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Fri Aug 30 19:27:35 2019 +0300

    WebSockets: plug another leak in the send_message() method
    
    The GByteArray allocated in the beginning is not freed in case
    of error.

 libsoup/soup-websocket-connection.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c
index 3218a71f..341d32d1 100644
--- a/libsoup/soup-websocket-connection.c
+++ b/libsoup/soup-websocket-connection.c
@@ -480,6 +480,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);
                        return;
                }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]