[Asterisk-code-review] tcptls: Prevent crash when freeing OpenSSL errors. (asterisk[18])

N A asteriskteam at digium.com
Mon Oct 31 07:55:01 CDT 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19509 )


Change subject: tcptls: Prevent crash when freeing OpenSSL errors.
......................................................................

tcptls: Prevent crash when freeing OpenSSL errors.

write_openssl_error_to_log has been erroneously
using ast_free instead of free, which will
cause a crash when MALLOC_DEBUG is enabled since
the memory was not allocated by Asterisk's memory
manager. This changes it to use the actual free
function directly to avoid this.

ASTERISK-30278 #close

Change-Id: Iac8b6468b718075809c45d8ad16b101af21a474d
---
M main/tcptls.c
1 file changed, 19 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/09/19509/1

diff --git a/main/tcptls.c b/main/tcptls.c
index b2756d1..dc25cb4 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -126,7 +126,7 @@
 		ast_log(LOG_ERROR, "%.*s\n", (int) length, buffer);
 	}
 
-	ast_free(buffer);
+	ast_std_free(buffer);
 }
 #endif
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19509
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Iac8b6468b718075809c45d8ad16b101af21a474d
Gerrit-Change-Number: 19509
Gerrit-PatchSet: 1
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221031/9e538aeb/attachment.html>


More information about the asterisk-code-review mailing list