diff options
author | Bodo Möller <bodo@openssl.org> | 2001-01-10 20:26:34 +0100 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-01-10 20:26:34 +0100 |
commit | b93642c5ccf3274e505080768f9ac199b036cc1d (patch) | |
tree | df569e2f3760c2747dc7b3f14aab21078fb9cdde /crypto/mem.c | |
parent | After discussion with Richard, change the new API for extended memory (diff) | |
download | openssl-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.c | 9 |
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; } |