aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-08-01 10:08:53 +0000
committerRichard Levitte <levitte@openssl.org>2002-08-01 10:08:53 +0000
commit6de41cf0d974e47fa689a73a2a8c5496b58e134f (patch)
treeaede79563c15071379e82aea2c3b7fd8133200fb
parentf8acaa92ec76592322f0c63dc1c1b05e712e638b (diff)
downloadopenssl-6de41cf0d974e47fa689a73a2a8c5496b58e134f.tar.gz
If CRYPTO_realloc() is called with a NULL pointer, have it call
OPENSSL_malloc(). PR: 187
-rw-r--r--crypto/mem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/mem.c b/crypto/mem.c
index 3b5b2bbc68..9df2a367e7 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -226,6 +226,9 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line)
{
void *ret = NULL;
+ if (str == NULL)
+ return CRYPTO_malloc(num, file, line);
+
if (realloc_debug_func != NULL)
realloc_debug_func(str, NULL, num, file, line, 0);
ret = realloc_func(str,num);