forked from wolfSSL/wolfssl
error out earlier in get_chain_X509
This commit is contained in:
@@ -8620,12 +8620,14 @@ CYASSL_X509* CyaSSL_get_chain_X509(CYASSL_X509_CHAIN* chain, int idx)
|
|||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
CYASSL_MSG("Failed to parse cert");
|
CYASSL_MSG("Failed to parse cert");
|
||||||
FreeDecodedCert(&dCert);
|
FreeDecodedCert(&dCert);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
x509 = (CYASSL_X509*)XMALLOC(sizeof(CYASSL_X509), NULL, DYNAMIC_TYPE_X509);
|
x509 = (CYASSL_X509*)XMALLOC(sizeof(CYASSL_X509), NULL, DYNAMIC_TYPE_X509);
|
||||||
if (x509 == NULL) {
|
if (x509 == NULL) {
|
||||||
CYASSL_MSG("Failed alloc X509");
|
CYASSL_MSG("Failed alloc X509");
|
||||||
FreeDecodedCert(&dCert);
|
FreeDecodedCert(&dCert);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
InitX509(x509, 1);
|
InitX509(x509, 1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user