[libsoup/libsoup-3-0] soup-auth-ntlm: Fix a memory leak
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/libsoup-3-0] soup-auth-ntlm: Fix a memory leak
- Date: Fri, 22 Apr 2022 12:21:29 +0000 (UTC)
commit 297a50ae19152dc78e6e1f82625cda7f120fe64e
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 457cc98b..8fdadf14 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]