summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/mem.c6
-rw-r--r--src/lib/libssl/src/crypto/mem.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/libcrypto/mem.c b/src/lib/libcrypto/mem.c
index a7826908e6..87d0ebc714 100644
--- a/src/lib/libcrypto/mem.c
+++ b/src/lib/libcrypto/mem.c
@@ -251,6 +251,8 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line)
251 { 251 {
252 void *ret = NULL; 252 void *ret = NULL;
253 253
254 if (num < 0) return NULL;
255
254 allow_customize = 0; 256 allow_customize = 0;
255 if (malloc_debug_func != NULL) 257 if (malloc_debug_func != NULL)
256 { 258 {
@@ -283,6 +285,8 @@ void *CRYPTO_malloc(int num, const char *file, int line)
283 { 285 {
284 void *ret = NULL; 286 void *ret = NULL;
285 287
288 if (num < 0) return NULL;
289
286 allow_customize = 0; 290 allow_customize = 0;
287 if (malloc_debug_func != NULL) 291 if (malloc_debug_func != NULL)
288 { 292 {
@@ -306,6 +310,8 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line)
306 if (str == NULL) 310 if (str == NULL)
307 return CRYPTO_malloc(num, file, line); 311 return CRYPTO_malloc(num, file, line);
308 312
313 if (num < 0) return NULL;
314
309 if (realloc_debug_func != NULL) 315 if (realloc_debug_func != NULL)
310 realloc_debug_func(str, NULL, num, file, line, 0); 316 realloc_debug_func(str, NULL, num, file, line, 0);
311 ret = realloc_ex_func(str,num,file,line); 317 ret = realloc_ex_func(str,num,file,line);
diff --git a/src/lib/libssl/src/crypto/mem.c b/src/lib/libssl/src/crypto/mem.c
index a7826908e6..87d0ebc714 100644
--- a/src/lib/libssl/src/crypto/mem.c
+++ b/src/lib/libssl/src/crypto/mem.c
@@ -251,6 +251,8 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line)
251 { 251 {
252 void *ret = NULL; 252 void *ret = NULL;
253 253
254 if (num < 0) return NULL;
255
254 allow_customize = 0; 256 allow_customize = 0;
255 if (malloc_debug_func != NULL) 257 if (malloc_debug_func != NULL)
256 { 258 {
@@ -283,6 +285,8 @@ void *CRYPTO_malloc(int num, const char *file, int line)
283 { 285 {
284 void *ret = NULL; 286 void *ret = NULL;
285 287
288 if (num < 0) return NULL;
289
286 allow_customize = 0; 290 allow_customize = 0;
287 if (malloc_debug_func != NULL) 291 if (malloc_debug_func != NULL)
288 { 292 {
@@ -306,6 +310,8 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line)
306 if (str == NULL) 310 if (str == NULL)
307 return CRYPTO_malloc(num, file, line); 311 return CRYPTO_malloc(num, file, line);
308 312
313 if (num < 0) return NULL;
314
309 if (realloc_debug_func != NULL) 315 if (realloc_debug_func != NULL)
310 realloc_debug_func(str, NULL, num, file, line, 0); 316 realloc_debug_func(str, NULL, num, file, line, 0);
311 ret = realloc_ex_func(str,num,file,line); 317 ret = realloc_ex_func(str,num,file,line);