(_hx509_Name_to_string): free memory on failure (that should not happen) [CID 176]

This commit is contained in:
Love Hornquist Astrand
2009-07-30 07:25:36 +02:00
parent 4e516cec33
commit b1dc4dc97e

View File

@@ -235,8 +235,10 @@ _hx509_Name_to_string(const Name *n, char **str)
if (ss == NULL)
_hx509_abort("allocation failure"); /* XXX */
ret = wind_ucs2utf8(bmp, bmplen, ss, NULL);
if (ret)
if (ret) {
free(ss);
return ret;
}
ss[k] = '\0';
break;
}
@@ -260,8 +262,10 @@ _hx509_Name_to_string(const Name *n, char **str)
if (ss == NULL)
_hx509_abort("allocation failure"); /* XXX */
ret = wind_ucs4utf8(uni, unilen, ss, NULL);
if (ret)
if (ret) {
free(ss);
return ret;
}
ss[k] = '\0';
break;
}