aboutsummaryrefslogtreecommitdiff
path: root/crypto/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/mem.c')
-rw-r--r--crypto/mem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/mem.c b/crypto/mem.c
index f6cdcf5a423e..bc9dc111676f 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -195,7 +195,6 @@ void *CRYPTO_zalloc(size_t num, const char *file, int line)
void *ret;
ret = CRYPTO_malloc(num, file, line);
- FAILTEST();
if (ret != NULL)
memset(ret, 0, num);
@@ -208,7 +207,6 @@ void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
if (realloc_impl != CRYPTO_realloc)
return realloc_impl(str, num, file, line);
- FAILTEST();
if (str == NULL)
return CRYPTO_malloc(num, file, line);
@@ -217,6 +215,7 @@ void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
return NULL;
}
+ FAILTEST();
return realloc(str, num);
}