Merge pull request #637 from JacobBarthelmeh/master

PKCS12 : return on memory error
pull/639/head
toddouska 2016-11-18 11:03:57 -08:00 committed by GitHub
commit b380eef3e2
1 changed files with 2 additions and 1 deletions

View File

@ -920,11 +920,12 @@ int wc_PKCS12_parse(WC_PKCS12* pkcs12, const char* psw,
if (k == NULL) {
freeBuffers(*pkey, buf, pkcs12->heap);
freeCertList(certList, pkcs12->heap);
return MEMORY_E;
}
}
size = ret;
if (*pkey == NULL) {
if (*pkey == NULL) {
*pkey = k;
*pkeySz = size;
}