Fix leak in hx509_general_name_unparse()

This commit is contained in:
Nicolas Williams
2016-11-20 15:38:21 -06:00
parent d9f7718a42
commit 943e76f99b
2 changed files with 10 additions and 1 deletions

View File

@@ -844,7 +844,8 @@ check_key_usage(hx509_context context, const Certificate *cert,
_hx509_unparse_Name(&cert->tbsCertificate.subject, &name);
hx509_set_error_string(context, 0, HX509_KU_CERT_MISSING,
"Key usage %s required but missing "
"from certifiate %s", buf, name);
"from certifiate %s", buf,
name ? name : "<unknown>");
free(name);
return HX509_KU_CERT_MISSING;
}