From 946d74674a3b7862ea53279159c47b69f17ef671 Mon Sep 17 00:00:00 2001 From: Florian Wilkens Date: Fri, 25 Jun 2021 16:04:41 +0200 Subject: [PATCH] ssl/analyzer: potentially fix memory leaks caused by bytestrings --- src/analyzer/protocol/ssl/tls-handshake-protocol.pac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/analyzer/protocol/ssl/tls-handshake-protocol.pac b/src/analyzer/protocol/ssl/tls-handshake-protocol.pac index 628dd3da48..b42f292720 100644 --- a/src/analyzer/protocol/ssl/tls-handshake-protocol.pac +++ b/src/analyzer/protocol/ssl/tls-handshake-protocol.pac @@ -959,6 +959,11 @@ refine connection Handshake_Conn += { gmt_unix_time_ = 0; %} + %cleanup{ + client_random_.free(); + server_random_.free(); + %} + function chosen_cipher() : int %{ return chosen_cipher_; %} function set_cipher(cipher: uint32) : bool @@ -995,6 +1000,7 @@ refine connection Handshake_Conn += { function set_client_random(client_random: bytestring) : bool %{ + client_random_.free(); client_random_.init(client_random.data(), client_random.length()); return true; %} @@ -1003,6 +1009,7 @@ refine connection Handshake_Conn += { function set_server_random(server_random: bytestring) : bool %{ + server_random_.free(); server_random_.init(server_random.data(), server_random.length()); return true; %}