In lib/hx509/cert.c, fix cases where errors are returned as certs.
commit1b5b82183c391c76f4c4e3f3766bc466921f9396
authorRoland C. Dowdeswell <elric@imrryr.org>
Mon, 3 Dec 2012 06:12:52 +0000 (3 14:12 +0800)
committerRoland C. Dowdeswell <elric@imrryr.org>
Mon, 3 Dec 2012 06:12:52 +0000 (3 14:12 +0800)
tree90ee259ca8ce107c920536412de590061a9345f5
parent27dd8621fb97c94e2642d71c5418691ed7494b81
In lib/hx509/cert.c, fix cases where errors are returned as certs.

In both hx509_cert_init() and hx509_cert_init_data(), there is an
output parameter for the error code but there are cases where the
error is used as a return value instead of the specified hx509_cert.
We fix these issues.  We also check if error is non-NULL and only
set the error in this case, allowing the functions to be called
with error == NULL without segfault.
lib/hx509/cert.c