summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/execute.c')
-rw-r--r--src/core/execute.c42
1 files changed, 12 insertions, 30 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 28eeeaad18..de5c16bd76 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1994,32 +1994,20 @@ void exec_context_done(ExecContext *c) {
c->environment_files = NULL;
for (l = 0; l < ELEMENTSOF(c->rlimit); l++) {
- free(c->rlimit[l]);
- c->rlimit[l] = NULL;
+ c->rlimit[l] = mfree(c->rlimit[l]);
}
- free(c->working_directory);
- c->working_directory = NULL;
- free(c->root_directory);
- c->root_directory = NULL;
-
- free(c->tty_path);
- c->tty_path = NULL;
-
- free(c->syslog_identifier);
- c->syslog_identifier = NULL;
-
- free(c->user);
- c->user = NULL;
-
- free(c->group);
- c->group = NULL;
+ c->working_directory = mfree(c->working_directory);
+ c->root_directory = mfree(c->root_directory);
+ c->tty_path = mfree(c->tty_path);
+ c->syslog_identifier = mfree(c->syslog_identifier);
+ c->user = mfree(c->user);
+ c->group = mfree(c->group);
strv_free(c->supplementary_groups);
c->supplementary_groups = NULL;
- free(c->pam_name);
- c->pam_name = NULL;
+ c->pam_name = mfree(c->pam_name);
if (c->capabilities) {
cap_free(c->capabilities);
@@ -2038,14 +2026,9 @@ void exec_context_done(ExecContext *c) {
if (c->cpuset)
CPU_FREE(c->cpuset);
- free(c->utmp_id);
- c->utmp_id = NULL;
-
- free(c->selinux_context);
- c->selinux_context = NULL;
-
- free(c->apparmor_profile);
- c->apparmor_profile = NULL;
+ c->utmp_id = mfree(c->utmp_id);
+ c->selinux_context = mfree(c->selinux_context);
+ c->apparmor_profile = mfree(c->apparmor_profile);
set_free(c->syscall_filter);
c->syscall_filter = NULL;
@@ -2090,8 +2073,7 @@ int exec_context_destroy_runtime_directory(ExecContext *c, const char *runtime_p
void exec_command_done(ExecCommand *c) {
assert(c);
- free(c->path);
- c->path = NULL;
+ c->path = mfree(c->path);
strv_free(c->argv);
c->argv = NULL;