From 1d451bdd999a254fc8321356514ed04e21e45a0b Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 3 Apr 2016 17:30:51 +0100 Subject: krb5: Small code tidy up * Prefer dereference of string pointer rather than strlen() * Free challenge pointer in one place * Additional comments --- lib/vauth/krb5_gssapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/vauth/krb5_gssapi.c') diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index 0e0db5bc4..8e1ea827b 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -113,7 +113,7 @@ CURLcode Curl_auth_create_gssapi_user_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,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data, mutual_auth, NULL); + /* Free the decoded challenge as it is not required anymore */ free(input_token.value); if(GSS_ERROR(major_status)) { -- cgit v1.2.3