Merge pull request #644 from cconlon/return_fix

correct MEMORY_E returns in asn.c
This commit is contained in:
toddouska
2016-11-28 10:58:06 -08:00
committed by GitHub

View File

@ -4300,7 +4300,7 @@ static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
DYNAMIC_TYPE_ALTNAME);
if (dnsEntry == NULL) {
WOLFSSL_MSG("\tOut of Memory");
return ASN_PARSE_E;
return MEMORY_E;
}
dnsEntry->name = (char*)XMALLOC(strLen + 1, cert->heap,
@ -4308,7 +4308,7 @@ static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
if (dnsEntry->name == NULL) {
WOLFSSL_MSG("\tOut of Memory");
XFREE(dnsEntry, cert->heap, DYNAMIC_TYPE_ALTNAME);
return ASN_PARSE_E;
return MEMORY_E;
}
XMEMCPY(dnsEntry->name, &input[idx], strLen);
@ -4336,7 +4336,7 @@ static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
DYNAMIC_TYPE_ALTNAME);
if (emailEntry == NULL) {
WOLFSSL_MSG("\tOut of Memory");
return ASN_PARSE_E;
return MEMORY_E;
}
emailEntry->name = (char*)XMALLOC(strLen + 1, cert->heap,
@ -4344,7 +4344,7 @@ static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
if (emailEntry->name == NULL) {
WOLFSSL_MSG("\tOut of Memory");
XFREE(emailEntry, cert->heap, DYNAMIC_TYPE_ALTNAME);
return ASN_PARSE_E;
return MEMORY_E;
}
XMEMCPY(emailEntry->name, &input[idx], strLen);