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);
mutual_auth,
NULL);
+ /* Free the decoded challenge as it is not required anymore */
free(input_token.value);
if(GSS_ERROR(major_status)) {
}
if(!krb5->credentials) {
+ /* Do we have credientials to use or are we using single sign-on? */
if(userp && *userp) {
/* Populate our identity structure */
result = Curl_create_sspi_identity(userp, passwdp, &krb5->identity);
memset(krb5->context, 0, sizeof(CtxtHandle));
}
- if(chlg64 && strlen(chlg64)) {
+ if(chlg64 && *chlg64) {
/* Decode the base-64 encoded challenge message */
if(*chlg64 != '=') {
result = Curl_base64_decode(chlg64, &chlg, &chlglen);
&resp_desc, &attrs,
&expiry);
- if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
- free(chlg);
+ /* Free the decoded challenge as it is not required anymore */
+ free(chlg);
+ if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
return CURLE_RECV_ERROR;
}
result = CURLE_OUT_OF_MEMORY;
}
- /* Free the decoded challenge */
- free(chlg);
-
return result;
}