free cert on error

This commit is contained in:
Love Hornquist Astrand
2009-10-22 08:23:19 -07:00
parent 610737fe90
commit 1af4e2234a

View File

@@ -283,6 +283,7 @@ hx509_cert_init_data(hx509_context context,
return ret;
}
if (size != len) {
free_Certificate(&t);
hx509_set_error_string(context, 0, HX509_EXTRA_DATA_AFTER_STRUCTURE,
"Extra data after certificate");
return HX509_EXTRA_DATA_AFTER_STRUCTURE;