Module: kamailio
Branch: 5.5
Commit: 1ff0d8bce7a84a2afca206cd5efee781edc264d6
URL:
https://github.com/kamailio/kamailio/commit/1ff0d8bce7a84a2afca206cd5efee78…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-06-24T18:34:47+02:00
tls: debug messages with memory management functions
(cherry picked from commit 81ace1c94369fb98081918acb55a6a13686784e3)
---
Modified: src/modules/tls/tls_init.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1ff0d8bce7a84a2afca206cd5efee78…
Patch:
https://github.com/kamailio/kamailio/commit/1ff0d8bce7a84a2afca206cd5efee78…
---
diff --git a/src/modules/tls/tls_init.c b/src/modules/tls/tls_init.c
index 8bdd14f2cc..b71bbbd28b 100644
--- a/src/modules/tls/tls_init.c
+++ b/src/modules/tls/tls_init.c
@@ -593,6 +593,12 @@ int tls_pre_init(void)
* this has to be called before any function calling CRYPTO_malloc,
* CRYPTO_malloc will set allow_customize in openssl to 0
*/
+ CRYPTO_get_mem_functions(&mf, &rf, &ff);
+ LM_DBG("initial memory functions - malloc: %p realloc: %p free: %p\n",
+ mf, rf, ff);
+ mf = NULL;
+ rf = NULL;
+ ff = NULL;
#ifdef TLS_MALLOC_DBG
if (!CRYPTO_set_mem_ex_functions(ser_malloc, ser_realloc, ser_free)) {
#else
@@ -602,10 +608,14 @@ int tls_pre_init(void)
CRYPTO_get_mem_functions(&mf, &rf, &ff);
LM_ERR("libssl current mem functions - m: %p r: %p f: %p\n",
mf, rf, ff);
+ LM_ERR("module mem functions - m: %p r: %p f: %p\n",
+ ser_malloc, ser_realloc, ser_free);
LM_ERR("Be sure tls module is loaded before any other module using"
" libssl (can be loaded first to be safe)\n");
return -1;
}
+ LM_DBG("updated memory functions - malloc: %p realloc: %p free: %p\n",
+ ser_malloc, ser_realloc, ser_free);
#endif /* LIBRESSL_VERSION_NUMBER */
if (tls_init_locks()<0)