Release the internal_name field of a SPNEGO context if it has not been
authorGreg Hudson <ghudson@mit.edu>
Fri, 5 Mar 2010 20:35:26 +0000 (20:35 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 5 Mar 2010 20:35:26 +0000 (20:35 +0000)
claimed for a caller argument.

ticket: 6674
target_version: 1.8.1
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23772 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/spnego/spnego_mech.c

index f7fcb5e5588a7a6d542760dbe116c4eee302931a..95e450979c0d06ef5d17851b36ba6972f2ae287e 100644 (file)
@@ -1742,6 +1742,7 @@ cleanup:
                if (sc->internal_name != GSS_C_NO_NAME &&
                    src_name != NULL) {
                        *src_name = sc->internal_name;
+                       sc->internal_name = GSS_C_NO_NAME;
                }
                release_spnego_ctx(&sc);
        } else if (ret != GSS_S_CONTINUE_NEEDED) {
@@ -2627,6 +2628,8 @@ release_spnego_ctx(spnego_gss_ctx_id_t *ctx)
                (void) generic_gss_release_oid(&minor_stat,
                                &context->internal_mech);
 
+               (void) gss_release_name(&minor_stat, &context->internal_name);
+
                if (context->optionStr != NULL) {
                        free(context->optionStr);
                        context->optionStr = NULL;