Correctly set Z_is_one on the return value in the NISTZ256 implementation.
[openssl.git] / crypto / mem.c
index 2ce3e894877df151a93743d138dd7dffbd5c65be..fdad49b76ec00a9cdf33234b2127e52cbf6c96e5 100644 (file)
@@ -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;
 }