Merge pull request #1412 from JacobBarthelmeh/PKCS12
clean up memory in error case with PKCS12 create
This commit is contained in:
commit
48cd2806af
@ -18268,12 +18268,14 @@ WC_PKCS12* wolfSSL_PKCS12_create(char* pass, char* name,
|
||||
|
||||
curDer = (byte*)wolfSSL_X509_get_der(sk->data.x509, &curDerSz);
|
||||
if (certDer == NULL || curDerSz < 0) {
|
||||
XFREE(cur, NULL, DYNAMIC_TYPE_PKCS);
|
||||
wc_FreeCertList(list, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cur->buffer = (byte*)XMALLOC(curDerSz, NULL, DYNAMIC_TYPE_PKCS);
|
||||
if (cur->buffer == NULL) {
|
||||
XFREE(cur, NULL, DYNAMIC_TYPE_PKCS);
|
||||
wc_FreeCertList(list, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user