44 lines
1.3 KiB
Diff
44 lines
1.3 KiB
Diff
|
|
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
|
||
|
|
|