From: Frantisek Sumsal Date: Thu, 19 Oct 2023 14:47:46 +0000 (+0200) Subject: core: properly cleanup ExecParameter's prefix array X-Git-Tag: v255-rc1~194^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F29628%2Fhead;p=thirdparty%2Fsystemd.git core: properly cleanup ExecParameter's prefix array --- diff --git a/src/core/execute.c b/src/core/execute.c index 46fb8805b3a..3f3d92d5050 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2255,7 +2255,13 @@ void exec_params_serialized_done(ExecParameters *p) { p->cgroup_path = mfree(p->cgroup_path); - p->prefix = strv_free(p->prefix); + if (p->prefix) { + for (ExecDirectoryType t = 0; t < _EXEC_DIRECTORY_TYPE_MAX; t++) + free(p->prefix[t]); + + p->prefix = mfree(p->prefix); + } + p->received_credentials_directory = mfree(p->received_credentials_directory); p->received_encrypted_credentials_directory = mfree(p->received_encrypted_credentials_directory);