summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/hx509/name.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/hx509/name.c')
-rw-r--r--source4/heimdal/lib/hx509/name.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/heimdal/lib/hx509/name.c b/source4/heimdal/lib/hx509/name.c
index b8f48d5236..23736edde3 100644
--- a/source4/heimdal/lib/hx509/name.c
+++ b/source4/heimdal/lib/hx509/name.c
@@ -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;
}