Fix memory leak in the error path of v2i_AUTHORITY_KEYID().
ok deraadt@ guenther@
Missing deallocation upon error.
ok deraadt@ guenther@
Be sure to check object allocation for success before using them.
Tweaks and ok guenther@
Memory leak upon error in set_dist_point_name().
ok guenther@
In v2i_AUTHORITY_INFO_ACCESS(), separate object allocation from object push
on a stack; if the latter fails, we need to free the object before returning
failure.
ok guenther@
Be sure to check the stack push operation for success in v2i_POLICY_MAPPINGS();
if it fails, free the object we were about to push.
Factor error handling to avoid having four copies of about the same code.
ok guenther@
The fixes to X509_PURPOSE_add() in r1.18 actually could cause a global
X509_PURPOSE object (obtained with X509_PURPOSE_get0() instead of being
allocated in the function) to be freed if modifying that object would fail
due to a low memory condition, while this object would still be referenced
elsewhere.
Fix this by only cleaning the object if we did not allocate it here.

While there, fail early if either `name' or `sname' are NULL, rather than
allocating an object and realizing we have nothing to strdup() into it.

ok guenther@