summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 1c0b0c72ac..d0e915909a 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3181,11 +3181,9 @@ int unit_require_mounts_for(Unit *u, const char *path) {
return 0;
}
- r = strv_push(&u->requires_mounts_for, p);
- if (r < 0) {
- free(p);
+ r = strv_consume(&u->requires_mounts_for, p);
+ if (r < 0)
return r;
- }
PATH_FOREACH_PREFIX_MORE(prefix, p) {
Set *x;