From: Richard Levitte Date: Thu, 1 Aug 2002 10:08:37 +0000 (+0000) Subject: If CRYPTO_realloc() is called with a NULL pointer, have it call X-Git-Tag: OpenSSL_0_9_7-beta4~218^2~40 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0472883cc224a6b6170d1c951f20da85152276f2;p=oweals%2Fopenssl.git If CRYPTO_realloc() is called with a NULL pointer, have it call OPENSSL_malloc(). PR: 187 --- diff --git a/crypto/mem.c b/crypto/mem.c index effec714e8..a7826908e6 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);