add error handling

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19575 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-12-29 17:39:48 +00:00
parent 79c50d6b5b
commit 6171869c5c

View File

@@ -251,11 +251,24 @@ ca_sign(hx509_context context,
ku = int2KeyUsage(key_usage);
ret = der_copy_oid(oid_id_x509_ce_keyUsage(), &ext.extnID);
if (ret) {
ret = ENOMEM;
hx509_set_error_string(context, 0, ret, "Out of memory");
goto out;
}
ASN1_MALLOC_ENCODE(KeyUsage,
ext.extnValue.data,
ext.extnValue.length,
&ku, &size, ret);
add_Extensions(tbsc->extensions, &ext);
if (ret) {
hx509_set_error_string(context, 0, ret, "Out of memory");
goto out;
}
ret = add_Extensions(tbsc->extensions, &ext);
if (ret) {
hx509_set_error_string(context, 0, ret, "Out of memory");
goto out;
}
free_Extension(&ext);
}