summaryrefslogtreecommitdiffstats
path: root/crypto/x509/x_pubkey.c
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-06-28 17:09:08 +0200
committerTomas Mraz <tomas@openssl.org>2021-06-29 18:41:45 +0200
commit475c5bbd1091717411d67b8662320a1b0a8c9e42 (patch)
treef63c2b94208e8fc47b40d9fab106b2da7b613b65 /crypto/x509/x_pubkey.c
parent69e14a546d5455de39222d1553ad18a1631e5fe9 (diff)
coverity #1486531: return error properly from x509_pubkey_ex_new_ex()
Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15942)
Diffstat (limited to 'crypto/x509/x_pubkey.c')
-rw-r--r--crypto/x509/x_pubkey.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c
index b20b756e9a..0c07c39a1f 100644
--- a/crypto/x509/x_pubkey.c
+++ b/crypto/x509/x_pubkey.c
@@ -116,6 +116,7 @@ static int x509_pubkey_ex_new_ex(ASN1_VALUE **pval, const ASN1_ITEM *it,
|| !x509_pubkey_ex_populate((ASN1_VALUE **)&ret, NULL)
|| !x509_pubkey_set0_libctx(ret, libctx, propq)) {
x509_pubkey_ex_free((ASN1_VALUE **)&ret, NULL);
+ ret = NULL;
ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
} else {
*pval = (ASN1_VALUE *)ret;