projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
check the return value of CRYPTO_strdup()
[openssl.git]
/
apps
/
req.c
diff --git
a/apps/req.c
b/apps/req.c
index 45de46d393598c0551f9aab472b9492bdc4927f8..76b337f6bc8e1837f6b92f3fda98916e771c1918 100644
(file)
--- a/
apps/req.c
+++ b/
apps/req.c
@@
-1588,6
+1588,13
@@
static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
*pkeytype = OPENSSL_strndup(keytype, keytypelen);
else
*pkeytype = OPENSSL_strdup(keytype);
+
+ if (*pkeytype == NULL) {
+ BIO_printf(bio_err, "Out of memory\n");
+ EVP_PKEY_free(param);
+ return NULL;
+ }
+
if (keylen >= 0)
*pkeylen = keylen;