(find_CMSIdentifier): only free string when we allocated one.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18048 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-09-07 09:11:30 +00:00
parent a45b9ccd18
commit 6e2407cfb9

View File

@@ -205,12 +205,13 @@ find_CMSIdentifier(hx509_context context,
len = hex_encode(ki->data, ki->length, &str);
if (len < 0)
hx509_clear_error_string(context);
else
else {
hx509_set_error_string(context, 0,
HX509_CMS_NO_RECIPIENT_CERTIFICATE,
"Failed to find cert with id: %s",
str);
free(str);
free(str);
}
return HX509_CMS_NO_RECIPIENT_CERTIFICATE;
}