]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sasl_sspi: Fixed a memory leak with the GSSAPI base-64 decoded challenge
authorSteve Holme <steve_holme@hotmail.com>
Sun, 17 Aug 2014 21:58:48 +0000 (22:58 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 17 Aug 2014 22:08:55 +0000 (23:08 +0100)
lib/curl_sasl_sspi.c

index 422b2f64c1d432248dc90195de00c9e314b3c579..df4da96456d9019678280378214b366488f9cb67 100644 (file)
@@ -416,8 +416,11 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data,
                                                &resp_desc, &attrs,
                                                &tsDummy);
 
-  if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED)
+  if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
+    Curl_safefree(chlg);
+
     return CURLE_RECV_ERROR;
+  }
 
   if(memcmp(&context, krb5->context, sizeof(context))) {
     s_pSecFn->DeleteSecurityContext(krb5->context);
@@ -431,6 +434,9 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data,
                                 resp_buf.cbBuffer, outptr, outlen);
   }
 
+  /* Free the decoded challenge */
+  Curl_safefree(chlg);
+
   return result;
 }