1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

core/execute: use FOREACH_ARRAY and free_many more

This commit is contained in:
Mike Yuan 2023-10-20 14:54:49 +08:00
parent 7a876307bb
commit fc932ed48f
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -555,8 +555,8 @@ void exec_context_done(ExecContext *c) {
c->syscall_archs = set_free(c->syscall_archs);
c->address_families = set_free(c->address_families);
for (ExecDirectoryType t = 0; t < _EXEC_DIRECTORY_TYPE_MAX; t++)
exec_directory_done(&c->directories[t]);
FOREACH_ARRAY(d, c->directories, _EXEC_DIRECTORY_TYPE_MAX)
exec_directory_done(d);
c->log_level_max = -1;
@ -2487,9 +2487,7 @@ void exec_params_serialized_done(ExecParameters *p) {
p->cgroup_path = mfree(p->cgroup_path);
if (p->prefix) {
for (ExecDirectoryType t = 0; t < _EXEC_DIRECTORY_TYPE_MAX; t++)
free(p->prefix[t]);
free_many_charp(p->prefix, _EXEC_DIRECTORY_TYPE_MAX);
p->prefix = mfree(p->prefix);
}