summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/sd-dhcp-server.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-02-01 07:49:52 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-02-01 07:49:52 +0100
commitc997f51c0f7e37beab594eb2394f47bd6f0d1b08 (patch)
tree6021d74ca6875d5b80ce43ad3076389ad9775f3b /src/libsystemd-network/sd-dhcp-server.c
parentnetwork: drop outdated TODO comment (diff)
downloadsystemd-c997f51c0f7e37beab594eb2394f47bd6f0d1b08.tar.xz
systemd-c997f51c0f7e37beab594eb2394f47bd6f0d1b08.zip
sd-dhcp-server: use free_and_replace() at one more place
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-server.c')
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index 9e462694c0..5774bc880e 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -1433,8 +1433,7 @@ int sd_dhcp_server_set_servers(
return -ENOMEM;
}
- free(server->servers[what].addr);
- server->servers[what].addr = c;
+ free_and_replace(server->servers[what].addr, c);
server->servers[what].size = n_addresses;
return 1;
}