[winpr,sspi] fix kerberos resource cleanup

kerberos cache and keytab were not properly cleaned up for cases where
the credentials were not available in kerberos
This commit is contained in:
akallabeth 2022-12-09 10:09:18 +01:00 committed by David Fort
parent 6613155275
commit c7bd8c3df9

View File

@ -344,11 +344,8 @@ cleanup:
if (rv)
kerberos_log_msg(ctx, rv);
if (domain)
free(domain);
if (username)
free(username);
if (password)
free(password);
if (principal)
@ -360,7 +357,16 @@ cleanup:
krb5_get_init_creds_opt_free(ctx, gic_opt);
#endif
if (ctx)
{
if (!credentials)
{
if (ccache)
krb5_cc_close(ctx, ccache);
if (keytab)
krb5_kt_close(ctx, keytab);
}
krb5_free_context(ctx);
}
/* If we managed to get credentials set the output */
if (credentials)