Fix leak in hx509_general_name_unparse()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -240,6 +240,8 @@ _hx509_Name_to_string(const Name *n, char **str)
|
||||
ret = wind_ucs2utf8_length(bmp, bmplen, &k);
|
||||
if (ret) {
|
||||
free(oidname);
|
||||
free(*str);
|
||||
*str = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -250,6 +252,8 @@ _hx509_Name_to_string(const Name *n, char **str)
|
||||
if (ret) {
|
||||
free(oidname);
|
||||
free(ss);
|
||||
free(*str);
|
||||
*str = NULL;
|
||||
return ret;
|
||||
}
|
||||
ss[k] = '\0';
|
||||
@@ -268,6 +272,8 @@ _hx509_Name_to_string(const Name *n, char **str)
|
||||
ret = wind_ucs4utf8_length(uni, unilen, &k);
|
||||
if (ret) {
|
||||
free(oidname);
|
||||
free(*str);
|
||||
*str = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -278,6 +284,8 @@ _hx509_Name_to_string(const Name *n, char **str)
|
||||
if (ret) {
|
||||
free(ss);
|
||||
free(oidname);
|
||||
free(*str);
|
||||
*str = NULL;
|
||||
return ret;
|
||||
}
|
||||
ss[k] = '\0';
|
||||
|
Reference in New Issue
Block a user