summaryrefslogtreecommitdiffstats
path: root/crypto/mem.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-11-03 00:06:02 +0000
committerRichard Levitte <levitte@openssl.org>2003-11-03 00:06:02 +0000
commit84bf37057c1d234be5aa90be5caaefcb97d096be (patch)
tree2b203c38a63146acac5aee046676266e3f948f44 /crypto/mem.c
parentffe8370a18f8123bb2b65a78c80977a51f3438ac (diff)
Changes from 0.9.7.
Diffstat (limited to 'crypto/mem.c')
-rw-r--r--crypto/mem.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/mem.c b/crypto/mem.c
index 29df7d35b2..bb862db499 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -352,11 +352,15 @@ void *CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file,
realloc_debug_func(str, NULL, num, file, line, 0);
ret=malloc_ex_func(num,file,line);
if(ret)
+ {
memcpy(ret,str,old_len);
- OPENSSL_cleanse(str,old_len);
- free_func(str);
+ OPENSSL_cleanse(str,old_len);
+ free_func(str);
+ }
#ifdef LEVITTE_DEBUG_MEM
- fprintf(stderr, "LEVITTE_DEBUG_MEM: | 0x%p -> 0x%p (%d)\n", str, ret, num);
+ fprintf(stderr,
+ "LEVITTE_DEBUG_MEM: | 0x%p -> 0x%p (%d)\n",
+ str, ret, num);
#endif
if (realloc_debug_func != NULL)
realloc_debug_func(str, ret, num, file, line, 1);