(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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user