execute: take ownership of more fields in ExecParameters

Let's simplify things a bit, and take ownership of more fields in
ExecParameters, so that they are automatically freed when the structure
is released.
This commit is contained in:
Lennart Poettering
2020-07-23 08:37:21 +02:00
parent 3bb4126262
commit c3f8a065e9
2 changed files with 18 additions and 19 deletions
+4 -1
View File
@@ -5761,7 +5761,10 @@ void exec_params_clear(ExecParameters *p) {
if (!p)
return;
strv_free(p->environment);
p->environment = strv_free(p->environment);
p->fd_names = strv_free(p->fd_names);
p->fds = mfree(p->fds);
p->exec_fd = safe_close(p->exec_fd);
}
static const char* const exec_input_table[_EXEC_INPUT_MAX] = {