summaryrefslogtreecommitdiff
path: root/lib/libcrypto/mem_dbg.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/mem_dbg.c')
-rw-r--r--lib/libcrypto/mem_dbg.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/libcrypto/mem_dbg.c b/lib/libcrypto/mem_dbg.c
index 8316485217a..dfeb0847993 100644
--- a/lib/libcrypto/mem_dbg.c
+++ b/lib/libcrypto/mem_dbg.c
@@ -330,7 +330,7 @@ static APP_INFO *pop_info(void)
return(ret);
}
-int CRYPTO_push_info_(const char *info, const char *file, int line)
+int CRYPTO_dbg_push_info(const char *info, const char *file, int line)
{
APP_INFO *ami, *amim;
int ret=0;
@@ -380,7 +380,7 @@ int CRYPTO_push_info_(const char *info, const char *file, int line)
return(ret);
}
-int CRYPTO_pop_info(void)
+int CRYPTO_dbg_pop_info(void)
{
int ret=0;
@@ -395,7 +395,7 @@ int CRYPTO_pop_info(void)
return(ret);
}
-int CRYPTO_remove_all_info(void)
+int CRYPTO_dbg_remove_all_info(void)
{
int ret=0;
@@ -793,3 +793,25 @@ void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb)
lh_doall_arg(mh, LHASH_DOALL_ARG_FN(cb_leak), &cb);
CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
}
+
+void CRYPTO_malloc_debug_init(void)
+ {
+ CRYPTO_set_mem_debug_functions(
+ CRYPTO_dbg_malloc,
+ CRYPTO_dbg_realloc,
+ CRYPTO_dbg_free,
+ CRYPTO_dbg_set_options,
+ CRYPTO_dbg_get_options);
+ CRYPTO_set_mem_info_functions(
+ CRYPTO_dbg_push_info,
+ CRYPTO_dbg_pop_info,
+ CRYPTO_dbg_remove_all_info);
+ }
+
+char *CRYPTO_strdup(const char *str, const char *file, int line)
+ {
+ char *ret = CRYPTO_malloc(strlen(str)+1, file, line);
+
+ strcpy(ret, str);
+ return ret;
+ }