]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sasl_sspi: Fix memory leak in domain populate
authorJay Satiro <raysatiro@yahoo.com>
Thu, 4 Feb 2016 23:11:07 +0000 (18:11 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 4 Feb 2016 23:11:07 +0000 (18:11 -0500)
Free an existing domain before replacing it.

Bug: https://github.com/curl/curl/issues/635
Reported-by: silveja1@users.noreply.github.com
lib/curl_sasl_sspi.c

index 1678e37865c5a4fe0da6d385f77bf1d59a4ba1a2..787eabfa32f0275b940a53b05df32c11f0e80ced 100644 (file)
@@ -316,6 +316,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg,
             Curl_unicodefree(domain.tchar_ptr);
             return CURLE_OUT_OF_MEMORY;
           }
+          free(identity->Domain);
           identity->Domain = dup_domain.tbyte_ptr;
           identity->DomainLength = curlx_uztoul(_tcslen(dup_domain.tchar_ptr));
           dup_domain.tchar_ptr = NULL;