gss: Fix leaks

This commit is contained in:
Nicolas Williams
2023-01-03 20:49:14 -06:00
parent a5093f6e0d
commit 27e5c40a79
2 changed files with 5 additions and 3 deletions

View File

@@ -453,7 +453,7 @@ gss_indicate_mechs_by_attrs(OM_uint32 * minor_status,
struct _gss_mech_switch *ms;
gss_OID_set mech_attrs = GSS_C_NO_OID_SET;
gss_OID_set known_mech_attrs = GSS_C_NO_OID_SET;
OM_uint32 major;
OM_uint32 major, tmp;
major = gss_create_empty_oid_set(minor_status, mechs);
if (GSS_ERROR(major))
@@ -464,7 +464,6 @@ gss_indicate_mechs_by_attrs(OM_uint32 * minor_status,
HEIM_TAILQ_FOREACH(ms, &_gss_mechs, gm_link) {
gssapi_mech_interface mi = &ms->gm_mech;
struct gss_mech_compat_desc_struct *gmc = mi->gm_compat;
OM_uint32 tmp;
if (gmc && gmc->gmc_inquire_attrs_for_mech) {
major = gmc->gmc_inquire_attrs_for_mech(minor_status,
@@ -493,6 +492,9 @@ gss_indicate_mechs_by_attrs(OM_uint32 * minor_status,
break;
}
if (major)
gss_release_oid_set(&tmp, mechs);
return major;
}

View File

@@ -82,7 +82,7 @@ get_ccache(krb5_context context, int *destroy, krb5_ccache *id)
ret = krb5_cc_cache_match(context, principal, id);
if (ret == 0)
return 0;
goto out;
/* did not find in default credcache, lets try default keytab */
ret = krb5_kt_default(context, &kt);