diff --git a/crypto/mem.c b/crypto/mem.c index 628b650216..5cbf474774 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -358,6 +358,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; }