diff options
Diffstat (limited to 'src/lib/libcrypto/mem.c')
-rw-r--r-- | src/lib/libcrypto/mem.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/libcrypto/mem.c b/src/lib/libcrypto/mem.c index 3b5b2bbc68..c0dc37c4bd 100644 --- a/src/lib/libcrypto/mem.c +++ b/src/lib/libcrypto/mem.c | |||
@@ -174,6 +174,8 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line) | |||
174 | { | 174 | { |
175 | void *ret = NULL; | 175 | void *ret = NULL; |
176 | 176 | ||
177 | if (num < 0) return NULL; | ||
178 | |||
177 | allow_customize = 0; | 179 | allow_customize = 0; |
178 | if (malloc_debug_func != NULL) | 180 | if (malloc_debug_func != NULL) |
179 | { | 181 | { |
@@ -206,6 +208,8 @@ void *CRYPTO_malloc(int num, const char *file, int line) | |||
206 | { | 208 | { |
207 | void *ret = NULL; | 209 | void *ret = NULL; |
208 | 210 | ||
211 | if (num < 0) return NULL; | ||
212 | |||
209 | allow_customize = 0; | 213 | allow_customize = 0; |
210 | if (malloc_debug_func != NULL) | 214 | if (malloc_debug_func != NULL) |
211 | { | 215 | { |
@@ -226,6 +230,8 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line) | |||
226 | { | 230 | { |
227 | void *ret = NULL; | 231 | void *ret = NULL; |
228 | 232 | ||
233 | if (num < 0) return NULL; | ||
234 | |||
229 | if (realloc_debug_func != NULL) | 235 | if (realloc_debug_func != NULL) |
230 | realloc_debug_func(str, NULL, num, file, line, 0); | 236 | realloc_debug_func(str, NULL, num, file, line, 0); |
231 | ret = realloc_func(str,num); | 237 | ret = realloc_func(str,num); |