(hx509_set_error_stringv): clear errors on malloc failure

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17401 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-05-01 15:25:46 +00:00
parent 7094fb5da1
commit eb4b4f87c2

View File

@@ -65,8 +65,11 @@ hx509_set_error_stringv(hx509_context context, int flags, int code,
hx509_error msg;
msg = calloc(1, sizeof(*msg));
if (msg == NULL)
if (msg == NULL) {
free_error_string(context->error);
context->error = NULL;
return;
}
if (vasprintf(&msg->msg, fmt, ap) == -1) {
free(msg);