diff --git a/crypto/mem.c b/crypto/mem.c index effec714e8223cdf8a087d47332cc9e1f317895c..a7826908e61ca9c3b4c562c15f6a22a77a00a5e7 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -303,6 +303,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_ex_func(str,num,file,line);