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 | 98c300ab90cc7775818c333931f1f923f9eb7763 (patch) | |
tree | bad55d39bc302bf61b6f2dcb29b8242eb6e2cccd /source3/libads/sasl.c | |
parent | 23d3a1956b00256897a921690f34e5e618f8fc3c (diff) | |
download | samba-98c300ab90cc7775818c333931f1f923f9eb7763.tar.gz |
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
(This used to be commit 8c6930b7013b185af0530b04a7d5a49bc2ce7831)
Diffstat (limited to 'source3/libads/sasl.c')
-rw-r--r-- | source3/libads/sasl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c index 013985a1215..ce000a13064 100644 --- a/source3/libads/sasl.c +++ b/source3/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); |