]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
tcptls: Prevent crash when freeing OpenSSL errors.
authorNaveen Albert <asterisk@phreaknet.org>
Thu, 27 Oct 2022 11:32:12 +0000 (11:32 +0000)
committerJoshua Colp <jcolp@sangoma.com>
Tue, 1 Nov 2022 11:31:40 +0000 (06:31 -0500)
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

main/tcptls.c

index b2756d1f8c2b60809687133252fd53f73c9ecd77..dc25cb4047fcc82a262421f185fc052b33820168 100644 (file)
@@ -126,7 +126,7 @@ static void write_openssl_error_to_log(void)
                ast_log(LOG_ERROR, "%.*s\n", (int) length, buffer);
        }
 
-       ast_free(buffer);
+       ast_std_free(buffer);
 }
 #endif