diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dbus-execute.c | 8 | ||||
-rw-r--r-- | src/core/locale-setup.c | 3 | ||||
-rw-r--r-- | src/core/unit.c | 6 |
3 files changed, 6 insertions, 11 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 6d0bdce9dc..3a05303f08 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -385,11 +385,9 @@ static int property_get_syscall_filter( if (!name) continue; - r = strv_push(&l, name); - if (r < 0) { - free(name); - return -ENOMEM; - } + r = strv_consume(&l, name); + if (r < 0) + return r; } #endif diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c index 276deb9dc1..7a4103504f 100644 --- a/src/core/locale-setup.c +++ b/src/core/locale-setup.c @@ -133,8 +133,7 @@ int locale_setup(char ***environment) { goto finish; } - if (strv_push(&add, s) < 0) { - free(s); + if (strv_consume(&add, s) < 0) { r = -ENOMEM; goto finish; } 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; |