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

Friendly Automation asteriskteam at digium.com
Mon Oct 31 12:49:29 CDT 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19461 )

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(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Verified
  Friendly Automation: Approved for Submit




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/+/19461
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Iac8b6468b718075809c45d8ad16b101af21a474d
Gerrit-Change-Number: 19461
Gerrit-PatchSet: 5
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221031/952d4cb5/attachment.html>


More information about the asterisk-code-review mailing list