diff options
author | Gisle Vanem <gvanem@broadpark.no> | 2013-02-08 15:50:23 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-02-08 15:51:27 +0100 |
commit | 463082bea42d8bea751303da340218a18fb67e85 (patch) | |
tree | da47b95c17444f87c5d642904d9a3bc728769b98 /lib | |
parent | 72688317adcedb9508fd2189e6c6d3945e06a004 (diff) | |
download | curl-463082bea42d8bea751303da340218a18fb67e85.tar.gz |
ntlm: fix memory leak
Running tests\libtest\libntlmconnect.exe reveals a 1 byte (!) leak in
./lib/curl_ntlm_msgs.c:
perl ..\memanalyze.pl c:memdebug.curl
Leak detected: memory still allocated: 1 bytes
At 9771e8, there's 1 bytes.
allocated by curl_ntlm_msgs.c:399
Snippet from curl_ntlm_msgs.c:
/* setup ntlm identity's domain and length */
dup_domain.tchar_ptr = malloc(sizeof(TCHAR) * (domlen + 1));
(my domlen == 0).
'dup_domain.tbyte_ptr' looks to be freed in Curl_ntlm_sspi_cleanup() via
'ntlm->identity.Domain'. But I see no freeing of 'dup_domain.tchar_ptr'.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/curl_ntlm_msgs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/curl_ntlm_msgs.c b/lib/curl_ntlm_msgs.c index 93334c601..c0a5e9ad5 100644 --- a/lib/curl_ntlm_msgs.c +++ b/lib/curl_ntlm_msgs.c @@ -405,6 +405,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp, *(dup_domain.tchar_ptr + domlen) = TEXT('\0'); ntlm->identity.Domain = dup_domain.tbyte_ptr; ntlm->identity.DomainLength = curlx_uztoul(domlen); + free(dup_domain.tchar_ptr); dup_domain.tchar_ptr = NULL; Curl_unicodefree(useranddomain.tchar_ptr); |