ryantimwilson / rpms / systemd

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