diff options
-rw-r--r-- | crypto/mem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/mem.c b/crypto/mem.c index 16ef64c6fe..9bdd5043a9 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -201,9 +201,10 @@ void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num, } ret = CRYPTO_malloc(num, file, line); - if (ret) + if (ret != NULL) { memcpy(ret, str, old_len); - CRYPTO_clear_free(str, old_len, file, line); + CRYPTO_clear_free(str, old_len, file, line); + } return ret; } |