diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index ea1c3df046..2e79fdf276 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -440,7 +440,7 @@ static int property_get_restrict_filesystems( sd_bus_error *error) { ExecContext *c = ASSERT_PTR(userdata); - _cleanup_free_ char **l = NULL; + _cleanup_free_ char **l = NULL; /* Strings are owned by 'c->restrict_filesystems'! */ int r; assert(bus); diff --git a/src/core/execute.c b/src/core/execute.c index b789a1b454..cca42583d1 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1979,19 +1979,17 @@ char** exec_context_get_address_families(const ExecContext *c) { } char** exec_context_get_restrict_filesystems(const ExecContext *c) { - _cleanup_strv_free_ char **l = NULL; - assert(c); #if HAVE_LIBBPF - l = set_get_strv(c->restrict_filesystems); + char **l = set_get_strv(c->restrict_filesystems); if (!l) return NULL; - strv_sort(l); + return strv_sort(l); +#else + return strv_new(NULL); #endif - - return l ? TAKE_PTR(l) : strv_new(NULL); } void exec_status_start(ExecStatus *s, pid_t pid, const dual_timestamp *ts) {