Skip to content

Commit

Permalink
tcptls: Prevent crash when freeing OpenSSL errors.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
InterLinked1 authored and Friendly Automation committed Oct 31, 2022
1 parent 7eaa7b0 commit e0d2433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main/tcptls.c
Expand Up @@ -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

Expand Down

0 comments on commit e0d2433

Please sign in to comment.