From bef050c8d5887f3bcf923dd5a275d9c67f47a6d4 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Thu, 1 Jun 2023 02:46:35 +0000
Subject: [PATCH 79/79] !2037 archive reader close if copy to container failed
 * archive reader close if copy to container failed

---
 src/cmd/isula/stream/cp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/cmd/isula/stream/cp.c b/src/cmd/isula/stream/cp.c
index f85602ed..2b0a79c7 100644
--- a/src/cmd/isula/stream/cp.c
+++ b/src/cmd/isula/stream/cp.c
@@ -214,10 +214,8 @@ static int client_copy_to_container(const struct client_arguments *args, const c
 
     config = get_connect_config(args);
     ret = ops->container.copy_to_container(&request, response, &config);
-    if (ret) {
-        goto out;
-    }
 
+    // archive reader close if copy to container failed
     nret = archive_reader.close(archive_reader.context, &archive_err);
     if (nret < 0) {
         ret = nret;
-- 
2.25.1

