From 23f4c735d366334dfb3a44dbc6cf986cd36cd27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BD=B3=E4=BC=9F?= Date: Sat, 19 Jul 2025 10:41:43 +0800 Subject: [PATCH] =?UTF-8?q?Description:=E5=86=85=E5=AD=98=E6=B3=84?= =?UTF-8?q?=E6=BC=8F=E6=95=B4=E6=94=B9=20IssueNo:https://gitee.com/openhar?= =?UTF-8?q?mony/startup=5Finit/issues/ICND18=20Binary=20Source:No=20Signed?= =?UTF-8?q?-off-by:=20songjiawei9=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/sandbox/sandbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/sandbox/sandbox.c b/services/sandbox/sandbox.c index b612e4919..fb2735647 100755 --- a/services/sandbox/sandbox.c +++ b/services/sandbox/sandbox.c @@ -239,7 +239,8 @@ static int AddMountInfoToSandbox(sandbox_t *sandbox, cJSON *item, const char *ty tmpMount->source = strdup(srcPath); BEGET_ERROR_CHECK(tmpMount->source != NULL, free(tmpMount); return -1, "Failed to dup source"); tmpMount->target = strdup(dstPath); - BEGET_ERROR_CHECK(tmpMount->target != NULL, free(tmpMount); return -1, "Failed to dup target"); + BEGET_ERROR_CHECK(tmpMount->target != NULL, free(tmpMount->source); free(tmpMount); return -1, + "Failed to dup target"); for (int i = 0; i < count; i++) { cJSON *item = cJSON_GetArrayItem(obj, i); tmpMount->flags |= GetSandboxMountFlags(item); -- Gitee