summaryrefslogtreecommitdiff
path: root/0039-use-auto-free-to-proc_t.patch
blob: 25de87e9b1839b369ec6ffdffb8fe3a1c525ca1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 0a68a53ccb6582384dad478d4197ec9386306027 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 6 Mar 2023 10:56:16 +0800
Subject: [PATCH 39/53] use auto free to proc_t

Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
 src/daemon/modules/runtime/isula/isula_rt_ops.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c
index 536e36b2..5ec0e639 100644
--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c
+++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c
@@ -951,8 +951,8 @@ int rt_isula_start(const char *id, const char *runtime, const rt_start_params_t
     pid_t shim_pid = -1;
     int ret = -1;
     int splice_ret = 0;
-    proc_t *proc = NULL;
-    proc_t *p_proc = NULL;
+    __isula_auto_free proc_t *proc = NULL;
+    __isula_auto_free proc_t *p_proc = NULL;
 
     if (id == NULL || runtime == NULL || params == NULL || pid_info == NULL) {
         ERROR("nullptr arguments not allowed");
@@ -1009,14 +1009,6 @@ out:
         show_shim_runtime_errlog(workdir);
         shim_kill_force(workdir);
     }
-
-    if (proc != NULL) {
-        free(proc);
-    }
-    if (p_proc != NULL) {
-        free(p_proc);
-    }
-
     return ret;
 }
 
-- 
2.25.1