networkd: keep static lease section valid on MACAddress= reset
config_parse_dhcp_static_lease_hwaddr() uses a cleanup helper that marks a lease section invalid unless ownership is taken. Add TAKE_PTR(lease) on the empty-rvalue reset path so subsequent valid MACAddress= assignments in the same section are not dropped. Co-developed-by: Codex (GPT-5) <noreply@openai.com>
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
df45055942
commit
34649c6f55
@@ -188,6 +188,7 @@ int config_parse_dhcp_static_lease_hwaddr(
|
||||
if (isempty(rvalue)) {
|
||||
lease->client_id = mfree(lease->client_id);
|
||||
lease->client_id_size = 0;
|
||||
TAKE_PTR(lease);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user