free on failure

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25027 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-04-03 04:01:15 +00:00
parent 71bab6db75
commit 47de5125a8

View File

@@ -286,7 +286,12 @@ krb5_cc_new_unique(krb5_context context, const char *type,
ret = _krb5_cc_allocate(context, ops, id);
if (ret)
return ret;
return (*id)->ops->gen_new(context, id);
ret = (*id)->ops->gen_new(context, id);
if (ret) {
free(*id);
*id = NULL;
}
return ret;
}
/**