summaryrefslogtreecommitdiffstats
path: root/crypto/mem.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2001-01-10 20:26:34 +0100
committerBodo Möller <bodo@openssl.org>2001-01-10 20:26:34 +0100
commitb93642c5ccf3274e505080768f9ac199b036cc1d (patch)
treedf569e2f3760c2747dc7b3f14aab21078fb9cdde /crypto/mem.c
parentAfter discussion with Richard, change the new API for extended memory (diff)
downloadopenssl-b93642c5ccf3274e505080768f9ac199b036cc1d.tar.xz
openssl-b93642c5ccf3274e505080768f9ac199b036cc1d.zip
No functional change, but slightly improved code clarity.
Diffstat (limited to 'crypto/mem.c')
-rw-r--r--crypto/mem.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/mem.c b/crypto/mem.c
index a4a78807f7..effec714e8 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -198,8 +198,10 @@ int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
void CRYPTO_get_mem_functions(void *(**m)(size_t), void *(**r)(void *, size_t),
void (**f)(void *))
{
- if (m != NULL) *m=malloc_func;
- if (r != NULL) *r=realloc_func;
+ if (m != NULL) *m = (malloc_ex_func == default_malloc_ex) ?
+ malloc_func : 0;
+ if (r != NULL) *r = (realloc_ex_func == default_realloc_ex) ?
+ realloc_func : 0;
if (f != NULL) *f=free_func;
}
@@ -217,7 +219,8 @@ void CRYPTO_get_mem_ex_functions(
void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *))
{
- if (m != NULL) *m=malloc_locked_func;
+ if (m != NULL) *m = (malloc_locked_ex_func == default_malloc_locked_ex) ?
+ malloc_locked_func : 0;
if (f != NULL) *f=free_locked_func;
}