lib/krb5: pa_gss_step do not leak 'from' if unparse cname fails

Change-Id: I9edcaab26b5197265dabc5feae0f83fd1c60686c
This commit is contained in:
Jeffrey Altman
2022-01-16 17:07:05 -05:00
parent 8eaecdaa59
commit 43592b2e78

View File

@@ -1425,12 +1425,13 @@ pa_gss_step(krb5_context context,
char *from = NULL;
char *to = NULL;
if (krb5_unparse_name(context, ctx->cred.client, &from) == 0 &&
krb5_unparse_name(context, cname, &to) == 0) {
_krb5_debug(context, 1, "pa_gss_step: %s as %s",
from, to);
if (krb5_unparse_name(context, ctx->cred.client, &from) == 0) {
if (krb5_unparse_name(context, cname, &to) == 0) {
_krb5_debug(context, 1, "pa_gss_step: %s as %s",
from, to);
krb5_xfree(to);
}
krb5_xfree(from);
krb5_xfree(to);
}
}