richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
594167
From 08b6aa9dfbe9476ad71b48edd0f4454511d9ac19 Mon Sep 17 00:00:00 2001
594167
From: Shreenidhi Shedi <sshedi@vmware.com>
594167
Date: Sat, 4 Jun 2022 15:24:08 +0530
594167
Subject: [PATCH] execute: fix resource leak
594167
594167
CID#1431998
594167
594167
(cherry picked from commit 41abd7f6dfe09ccc78cdbdcdec3bdcc10be40faf)
594167
Related: #2087652
594167
---
594167
 src/core/execute.c | 2 +-
594167
 1 file changed, 1 insertion(+), 1 deletion(-)
594167
594167
diff --git a/src/core/execute.c b/src/core/execute.c
594167
index 2ab65e9cfe..8a1d070e26 100644
594167
--- a/src/core/execute.c
594167
+++ b/src/core/execute.c
594167
@@ -3331,7 +3331,7 @@ static int apply_mount_namespace(
594167
         /* Symlinks for exec dirs are set up after other mounts, before they are made read-only. */
594167
         r = compile_symlinks(context, params, &symlinks);
594167
         if (r < 0)
594167
-                return r;
594167
+                goto finalize;
594167
 
594167
         needs_sandboxing = (params->flags & EXEC_APPLY_SANDBOXING) && !(command_flags & EXEC_COMMAND_FULLY_PRIVILEGED);
594167
         if (needs_sandboxing) {