aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/mem.c')
-rw-r--r--crypto/mem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/mem.c b/crypto/mem.c
index 2ce3e894877d..fdad49b76ec0 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -365,6 +365,9 @@ char *CRYPTO_strdup(const char *str, const char *file, int line)
{
char *ret = CRYPTO_malloc(strlen(str) + 1, file, line);
+ if (ret == NULL)
+ return NULL;
+
strcpy(ret, str);
return ret;
}