]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: use strv_free_and_replace() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 15 Aug 2020 09:26:23 +0000 (18:26 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 15 Sep 2020 07:36:34 +0000 (09:36 +0200)
src/core/device.c

index 31aa3341c2ba0828c8472e8424bc981620c86e75..595b009cd935244cb33190e879617af1c7371d49 100644 (file)
@@ -441,10 +441,7 @@ static int device_add_udev_wants(Unit *u, sd_device *dev) {
                 }
         }
 
-        strv_free(d->wants_property);
-        d->wants_property = TAKE_PTR(added);
-
-        return 0;
+        return strv_free_and_replace(d->wants_property, added);
 }
 
 static bool device_is_bound_by_mounts(Device *d, sd_device *dev) {