summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/mem.c')
-rw-r--r--src/lib/libcrypto/mem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/mem.c b/src/lib/libcrypto/mem.c
index bb862db499..dd86733b77 100644
--- a/src/lib/libcrypto/mem.c
+++ b/src/lib/libcrypto/mem.c
@@ -252,7 +252,7 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line)
252 void *ret = NULL; 252 void *ret = NULL;
253 extern unsigned char cleanse_ctr; 253 extern unsigned char cleanse_ctr;
254 254
255 if (num < 0) return NULL; 255 if (num <= 0) return NULL;
256 256
257 allow_customize = 0; 257 allow_customize = 0;
258 if (malloc_debug_func != NULL) 258 if (malloc_debug_func != NULL)
@@ -293,7 +293,7 @@ void *CRYPTO_malloc(int num, const char *file, int line)
293 void *ret = NULL; 293 void *ret = NULL;
294 extern unsigned char cleanse_ctr; 294 extern unsigned char cleanse_ctr;
295 295
296 if (num < 0) return NULL; 296 if (num <= 0) return NULL;
297 297
298 allow_customize = 0; 298 allow_customize = 0;
299 if (malloc_debug_func != NULL) 299 if (malloc_debug_func != NULL)
@@ -324,7 +324,7 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line)
324 if (str == NULL) 324 if (str == NULL)
325 return CRYPTO_malloc(num, file, line); 325 return CRYPTO_malloc(num, file, line);
326 326
327 if (num < 0) return NULL; 327 if (num <= 0) return NULL;
328 328
329 if (realloc_debug_func != NULL) 329 if (realloc_debug_func != NULL)
330 realloc_debug_func(str, NULL, num, file, line, 0); 330 realloc_debug_func(str, NULL, num, file, line, 0);
@@ -346,7 +346,7 @@ void *CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file,
346 if (str == NULL) 346 if (str == NULL)
347 return CRYPTO_malloc(num, file, line); 347 return CRYPTO_malloc(num, file, line);
348 348
349 if (num < 0) return NULL; 349 if (num <= 0) return NULL;
350 350
351 if (realloc_debug_func != NULL) 351 if (realloc_debug_func != NULL)
352 realloc_debug_func(str, NULL, num, file, line, 0); 352 realloc_debug_func(str, NULL, num, file, line, 0);