mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix crash when reloading DHCP config on SIGHUP.
Confusion in the code to free old DHCP configuration when it's being reloaded causes invalid pointers to be followed and a crash. https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2024q4/017764.html has a more complete explanation of the problem.
This commit is contained in:
@@ -1360,7 +1360,13 @@ static void dhcp_netid_list_free(struct dhcp_netid_list *netid)
|
|||||||
{
|
{
|
||||||
struct dhcp_netid_list *tmplist = netid;
|
struct dhcp_netid_list *tmplist = netid;
|
||||||
netid = netid->next;
|
netid = netid->next;
|
||||||
dhcp_netid_free(tmplist->list);
|
/* Note: don't use dhcp_netid_free() here, since that
|
||||||
|
frees a list linked on netid->next. Where a netid_list
|
||||||
|
is used that's because the the ->next pointers in the
|
||||||
|
netids are being used to temporarily construct
|
||||||
|
a list of valid tags. */
|
||||||
|
free(tmplist->list->net);
|
||||||
|
free(tmplist->list);
|
||||||
free(tmplist);
|
free(tmplist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user