diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-04-04 14:50:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:09 -0500 |
commit | 8c6930b7013b185af0530b04a7d5a49bc2ce7831 (patch) | |
tree | c5a00f3103cc145482c27fbc71eaafa0f534480e /source/libads/sasl.c | |
parent | 721375e14cfcef88061c9e4d4a1f3ca2f33fa9aa (diff) | |
download | samba-8c6930b7013b185af0530b04a7d5a49bc2ce7831.tar.gz samba-8c6930b7013b185af0530b04a7d5a49bc2ce7831.tar.xz samba-8c6930b7013b185af0530b04a7d5a49bc2ce7831.zip |
r22078: fix memory leak in not often used code, we only use it if the server
doesn't support GSS-SPNEGO in SASL
can someone please review this, maybe it's also for 3.0.25
metze
Diffstat (limited to 'source/libads/sasl.c')
-rw-r--r-- | source/libads/sasl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/libads/sasl.c b/source/libads/sasl.c index 013985a1215..ce000a13064 100644 --- a/source/libads/sasl.c +++ b/source/libads/sasl.c @@ -301,7 +301,7 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads) uint32 minor_status; gss_name_t serv_name; gss_buffer_desc input_name; - gss_ctx_id_t context_handle; + gss_ctx_id_t context_handle = GSS_C_NO_CONTEXT; gss_OID mech_type = GSS_C_NULL_OID; gss_buffer_desc output_token, input_token; uint32 ret_flags, conf_state; @@ -368,8 +368,6 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads) return ADS_ERROR_GSS(gss_rc, minor_status); } - context_handle = GSS_C_NO_CONTEXT; - input_token.value = NULL; input_token.length = 0; @@ -478,6 +476,8 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads) failed: gss_release_name(&minor_status, &serv_name); + if (context_handle != GSS_C_NO_CONTEXT) + gss_delete_sec_context(&min_status, &context_handle, GSS_C_NO_BUFFER); krb5_free_principal(ctx, principal); krb5_free_context(ctx); |