diff --git a/main/astmm.c b/main/astmm.c index 3a28f5d447..860dbd3d39 100644 --- a/main/astmm.c +++ b/main/astmm.c @@ -880,6 +880,9 @@ static char *handle_memory_show_allocations(struct ast_cli_entry *e, int cmd, st ast_cli(a->fd, "%10u bytes allocated%s by %20s() line %5u of %s\n", (unsigned int) reg->len, reg->cache ? " (cache)" : "", reg->func, reg->lineno, reg->file); + if (reg->bt) { + print_backtrace(reg->bt); + } selected_len += reg->len; if (reg->cache) { diff --git a/third-party/pjproject/patches/0030-revert_ssl.patch b/third-party/pjproject/patches/0030-revert_ssl.patch new file mode 100644 index 0000000000..99d52a4537 --- /dev/null +++ b/third-party/pjproject/patches/0030-revert_ssl.patch @@ -0,0 +1,45 @@ +diff --git a/pjlib/src/pj/ssl_sock_imp_common.h b/pjlib/src/pj/ssl_sock_imp_common.h +index 09f259ef7..4edbb3b82 100644 +--- a/pjlib/src/pj/ssl_sock_imp_common.h ++++ b/pjlib/src/pj/ssl_sock_imp_common.h +@@ -93,7 +93,7 @@ typedef struct circ_buf_t { + /* + * Secure socket structure definition. + */ +-struct pj_ssl_sock_t ++typedef struct pj_ssl_sock_t + { + pj_pool_t *pool; + pj_ssl_sock_t *parent; +@@ -139,7 +139,7 @@ struct pj_ssl_sock_t + + circ_buf_t circ_buf_output; + pj_lock_t *circ_buf_output_mutex; +-}; ++} pj_ssl_sock_t; + + + /* +diff --git a/pjlib/src/pj/ssl_sock_ossl.c b/pjlib/src/pj/ssl_sock_ossl.c +index b4ac5c15f..debb105b1 100644 +--- a/pjlib/src/pj/ssl_sock_ossl.c ++++ b/pjlib/src/pj/ssl_sock_ossl.c +@@ -37,6 +37,7 @@ + #if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 && \ + (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_OPENSSL) + ++#include "ssl_sock_imp_common.h" + #include "ssl_sock_imp_common.c" + + #define THIS_FILE "ssl_sock_ossl.c" +@@ -1575,10 +1576,6 @@ static void ssl_update_remote_cert_chain_info(pj_pool_t *pool, + { + int i; + +- /* For now, get_pem has to be PJ_TRUE */ +- pj_assert(get_pem); +- PJ_UNUSED_ARG(get_pem); +- + ci->raw_chain.cert_raw = (pj_str_t *)pj_pool_calloc(pool, + sk_X509_num(chain), + sizeof(pj_str_t)); diff --git a/third-party/pjproject/patches/0031-revert_ssl.patch b/third-party/pjproject/patches/0031-revert_ssl.patch new file mode 100644 index 0000000000..ddbf14cda2 --- /dev/null +++ b/third-party/pjproject/patches/0031-revert_ssl.patch @@ -0,0 +1,70 @@ +diff --git b/pjlib/src/pj/ssl_sock_ossl.c a/pjlib/src/pj/ssl_sock_ossl.c +index debb105b1..109c5c1e2 100644 +--- b/pjlib/src/pj/ssl_sock_ossl.c ++++ a/pjlib/src/pj/ssl_sock_ossl.c +@@ -1566,41 +1566,6 @@ static void get_cert_info(pj_pool_t *pool, pj_ssl_cert_info *ci, X509 *x, + } + } + +-/* Update remote certificates chain info. This function should be +- * called after handshake or renegotiation successfully completed. +- */ +-static void ssl_update_remote_cert_chain_info(pj_pool_t *pool, +- pj_ssl_cert_info *ci, +- STACK_OF(X509) *chain, +- pj_bool_t get_pem) +-{ +- int i; +- +- ci->raw_chain.cert_raw = (pj_str_t *)pj_pool_calloc(pool, +- sk_X509_num(chain), +- sizeof(pj_str_t)); +- ci->raw_chain.cnt = sk_X509_num(chain); +- +- for (i = 0; i < sk_X509_num(chain); i++) { +- BIO *bio; +- BUF_MEM *ptr; +- X509 *x = sk_X509_value(chain, i); +- +- bio = BIO_new(BIO_s_mem()); +- +- if (!PEM_write_bio_X509(bio, x)) { +- PJ_LOG(3, (THIS_FILE, "Error retrieving raw certificate info")); +- ci->raw_chain.cert_raw[i].ptr = NULL; +- ci->raw_chain.cert_raw[i].slen = 0; +- } else { +- BIO_write(bio, "\0", 1); +- BIO_get_mem_ptr(bio, &ptr); +- pj_strdup2(pool, &ci->raw_chain.cert_raw[i], ptr->data ); +- } +- +- BIO_free(bio); +- } +-} + + /* Update local & remote certificates info. This function should be + * called after handshake or renegotiation successfully completed. +@@ -1609,7 +1574,6 @@ static void ssl_update_certs_info(pj_ssl_sock_t *ssock) + { + ossl_sock_t *ossock = (ossl_sock_t *)ssock; + X509 *x; +- STACK_OF(X509) *chain; + + pj_assert(ssock->ssl_state == SSL_STATE_ESTABLISHED); + +@@ -1631,15 +1595,6 @@ static void ssl_update_certs_info(pj_ssl_sock_t *ssock) + } else { + pj_bzero(&ssock->remote_cert_info, sizeof(pj_ssl_cert_info)); + } +- +- chain = SSL_get_peer_cert_chain(ossock->ossl_ssl); +- if (chain) { +- ssl_update_remote_cert_chain_info(ssock->pool, +- &ssock->remote_cert_info, +- chain, PJ_TRUE); +- } else { +- ssock->remote_cert_info.raw_chain.cnt = 0; +- } + } + +