From 40ee1ba0dcda5dcae7fceeeb3550456819c683a1 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 9 Nov 2014 11:25:10 +0000 Subject: ntlm: Moved the native Target Info clean-up from HTTP specific function --- lib/curl_sasl.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'lib/curl_sasl.c') diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index e50d3d9d5..75af97f58 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -1182,6 +1182,28 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data, return Curl_ntlm_create_type3_message(data, userp, passwdp, ntlm, outptr, outlen); } + +#if !defined(USE_WINDOWS_SSPI) +/* + * Curl_sasl_ntlm_cleanup() + * + * This is used to clean up the ntlm specific data. + * + * Parameters: + * + * ntlm [in/out] - The ntlm data struct being cleaned up. + * + */ +void Curl_sasl_ntlm_cleanup(struct ntlmdata *ntlm) +{ + /* Free the target info */ + Curl_safefree(ntlm->target_info); + + /* Reset any variables */ + ntlm->target_info_len = 0; +} +#endif /* !USE_WINDOWS_SSPI */ + #endif /* USE_NTLM */ /* @@ -1240,13 +1262,16 @@ void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused) if(authused == SASL_MECH_GSSAPI) { Curl_sasl_gssapi_cleanup(&conn->krb5); } -#ifdef USE_NTLM +#endif + +#if defined(USE_NTLM) /* Cleanup the ntlm structure */ - else if(authused == SASL_MECH_NTLM) { + if(authused == SASL_MECH_NTLM) { Curl_sasl_ntlm_cleanup(&conn->ntlm); } #endif -#else + +#if !defined(USE_KRB5) && !defined(USE_NTLM) /* Reserved for future use */ (void)conn; (void)authused; -- cgit v1.2.3