[libsoup/wip/ntlm-memory-leak] soup-auth-ntlm: Fix a memory leak
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/ntlm-memory-leak] soup-auth-ntlm: Fix a memory leak
- Date: Fri, 22 Apr 2022 09:34:55 +0000 (UTC)
commit 7fb26666dc86821116590d118cf53cf1542d3328
Author: Milan Crha <mcrha redhat com>
Date: Fri Apr 22 11:33:41 2022 +0200
soup-auth-ntlm: Fix a memory leak
The soup_ntlm_parse_challenge() can be called multiple times, but it
doesn't free any previously stored value, thus causes a memory leak.
libsoup/auth/soup-auth-ntlm.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/libsoup/auth/soup-auth-ntlm.c b/libsoup/auth/soup-auth-ntlm.c
index 895e5d6d..7108a32c 100644
--- a/libsoup/auth/soup-auth-ntlm.c
+++ b/libsoup/auth/soup-auth-ntlm.c
@@ -758,12 +758,14 @@ soup_ntlm_parse_challenge (const char *challenge,
return FALSE;
}
+ g_free (*default_domain);
*default_domain = g_convert ((char *)chall + domain.offset,
domain.length, "UTF-8", "UCS-2LE",
NULL, NULL, NULL);
}
if (nonce) {
+ g_free (*nonce);
*nonce = g_memdup2 (chall + NTLM_CHALLENGE_NONCE_OFFSET,
NTLM_CHALLENGE_NONCE_LENGTH);
}
@@ -777,6 +779,7 @@ soup_ntlm_parse_challenge (const char *challenge,
g_free (chall);
return FALSE;
}
+ g_free (*target_info);
*target_info = g_memdup2 (chall + target.offset, target.length);
*target_info_sz = target.length;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]