49 lines
1.2 KiB
Diff
49 lines
1.2 KiB
Diff
|
|
From d16b995756dc079b1fdc2e63665793979f766a26 Mon Sep 17 00:00:00 2001
|
||
|
|
From: renmingshuai <renmingshuai@huawei.com>
|
||
|
|
Date: Sat, 30 Sep 2023 23:31:08 +0100
|
||
|
|
Subject: [PATCH] Fix memory leak when using --dhcp-optsfile with DHCPv6
|
||
|
|
options.
|
||
|
|
|
||
|
|
Conflict:NA
|
||
|
|
Reference:https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=d16b995756dc079b1fdc2e63665793979f766a26
|
||
|
|
---
|
||
|
|
src/option.c | 12 ++++++++++--
|
||
|
|
1 file changed, 10 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/src/option.c b/src/option.c
|
||
|
|
index 8322725..286f06b 100644
|
||
|
|
--- a/src/option.c
|
||
|
|
+++ b/src/option.c
|
||
|
|
@@ -5734,11 +5734,11 @@ static void clear_dynamic_conf(void)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
-static void clear_dynamic_opt(void)
|
||
|
|
+static void clear_dhcp_opt(struct dhcp_opt **dhcp_opts)
|
||
|
|
{
|
||
|
|
struct dhcp_opt *opts, *cp, **up;
|
||
|
|
|
||
|
|
- for (up = &daemon->dhcp_opts, opts = daemon->dhcp_opts; opts; opts = cp)
|
||
|
|
+ for (up = dhcp_opts, opts = *dhcp_opts; opts; opts = cp)
|
||
|
|
{
|
||
|
|
cp = opts->next;
|
||
|
|
|
||
|
|
@@ -5752,6 +5752,14 @@ static void clear_dynamic_opt(void)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
+static void clear_dynamic_opt(void)
|
||
|
|
+{
|
||
|
|
+ clear_dhcp_opt(&daemon->dhcp_opts);
|
||
|
|
+#ifdef HAVE_DHCP6
|
||
|
|
+ clear_dhcp_opt(&daemon->dhcp_opts6);
|
||
|
|
+#endif
|
||
|
|
+}
|
||
|
|
+
|
||
|
|
void reread_dhcp(void)
|
||
|
|
{
|
||
|
|
struct hostsfile *hf;
|
||
|
|
--
|
||
|
|
2.23.0
|
||
|
|
|