sd-dhecp-lease: use free_and_replace() at one more
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Sep 2018 09:04:08 +0000 (18:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Sep 2018 09:04:08 +0000 (18:04 +0900)
src/libsystemd-network/sd-dhcp-lease.c

index a65e616..45eab1d 100644 (file)
@@ -330,8 +330,7 @@ static int lease_parse_string(const uint8_t *option, size_t len, char **ret) {
                 if (!string)
                         return -ENOMEM;
 
-                free(*ret);
-                *ret = string;
+                free_and_replace(*ret, string);
         }
 
         return 0;