aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_sasl.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-11-09 11:25:10 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-11-09 11:47:40 +0000
commit40ee1ba0dcda5dcae7fceeeb3550456819c683a1 (patch)
treee5197d9f0bd0a6e609e829062e57742c7667c1c2 /lib/curl_sasl.c
parent474442dd564cab52d7732403eba5cd630764ba26 (diff)
ntlm: Moved the native Target Info clean-up from HTTP specific function
Diffstat (limited to 'lib/curl_sasl.c')
-rw-r--r--lib/curl_sasl.c31
1 files changed, 28 insertions, 3 deletions
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;