]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/device: use strv_consume()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 28 Apr 2022 11:41:34 +0000 (20:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 29 Apr 2022 19:14:10 +0000 (04:14 +0900)
src/core/device.c

index 21d1b50c42ca8ac229470358495447adee3f40ec..81e4cdcd856847b0cbbbb0f9845a641502f9e48d 100644 (file)
@@ -408,11 +408,9 @@ static int device_add_udev_wants(Unit *u, sd_device *dev) {
                 if (r < 0)
                         return log_unit_error_errno(u, r, "Failed to add Wants= dependency: %m");
 
-                r = strv_push(&added, k);
+                r = strv_consume(&added, TAKE_PTR(k));
                 if (r < 0)
                         return log_oom();
-
-                k = NULL;
         }
 
         if (d->state != DEVICE_DEAD)