]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-server: use free_and_replace() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 22 Jan 2022 17:46:46 +0000 (02:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 23 Jan 2022 19:18:20 +0000 (04:18 +0900)
src/libsystemd-network/sd-dhcp-server.c

index 78901fa2bf452db32a1823fee98916212972c7d2..45d5a9e59ca6a967e26b50ebbf780702f549787f 100644 (file)
@@ -667,8 +667,7 @@ static int parse_request(uint8_t code, uint8_t len, const void *option, void *us
                         if (!data)
                                 return -ENOMEM;
 
-                        free(req->client_id.data);
-                        req->client_id.data = data;
+                        free_and_replace(req->client_id.data, data);
                         req->client_id.length = len;
                 }