If CRYPTO_realloc() is called with a NULL pointer, have it call

OPENSSL_malloc().
PR: 187
This commit is contained in:
Richard Levitte 2002-08-01 10:08:45 +00:00
parent 8d37f07e09
commit 76b8f839c2

View File

@ -303,6 +303,9 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line)
{ {
void *ret = NULL; void *ret = NULL;
if (str == NULL)
return CRYPTO_malloc(num, file, line);
if (realloc_debug_func != NULL) if (realloc_debug_func != NULL)
realloc_debug_func(str, NULL, num, file, line, 0); realloc_debug_func(str, NULL, num, file, line, 0);
ret = realloc_ex_func(str,num,file,line); ret = realloc_ex_func(str,num,file,line);