aboutsummaryrefslogtreecommitdiff
path: root/lib/vauth/spnego_gssapi.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-04-03 17:32:10 +0100
committerSteve Holme <steve_holme@hotmail.com>2016-04-03 17:32:10 +0100
commit7a7cdf264dbf40210c728d1fb3293968826a0d38 (patch)
treec08bb53a2ff044b587c87eef490972632312167e /lib/vauth/spnego_gssapi.c
parent1d451bdd999a254fc8321356514ed04e21e45a0b (diff)
spnego: Small code tidy up
* Prefer dereference of string pointer rather than strlen() * Free challenge pointer in one place * Additional comments
Diffstat (limited to 'lib/vauth/spnego_gssapi.c')
-rw-r--r--lib/vauth/spnego_gssapi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c
index cf1fcf0d6..fd9a0ef7a 100644
--- a/lib/vauth/spnego_gssapi.c
+++ b/lib/vauth/spnego_gssapi.c
@@ -87,8 +87,8 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
return CURLE_LOGIN_DENIED;
}
- /* Generate our SPN */
if(!nego->spn) {
+ /* Generate our SPN */
char *spn = Curl_auth_build_gssapi_spn(service, host);
if(!spn)
return CURLE_OUT_OF_MEMORY;
@@ -113,7 +113,7 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
free(spn);
}
- if(chlg64 && strlen(chlg64)) {
+ if(chlg64 && *chlg64) {
/* Decode the base-64 encoded challenge message */
if(*chlg64 != '=') {
result = Curl_base64_decode(chlg64, &chlg, &chlglen);
@@ -144,6 +144,8 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
&output_token,
TRUE,
NULL);
+
+ /* Free the decoded challenge as it is not required anymore */
Curl_safefree(input_token.value);
nego->status = major_status;