blob: e038afd8b1bed90423a92cff48af80a06511f6ce (
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
44
45
46
47
48
49
50
51
52
|
From 933eceb4545a28dba44c72f183dc7104d0fea714 Mon Sep 17 00:00:00 2001
From: Xuepeng Xu <xuxuepeng1@huawei.com>
Date: Wed, 15 Feb 2023 12:19:40 +0800
Subject: [PATCH 11/53] Bugfix in config and executor
Signed-off-by: Xuepeng Xu <xuxuepeng1@huawei.com>
---
src/daemon/config/isulad_config.c | 2 +-
src/daemon/executor/container_cb/execution_create.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/daemon/config/isulad_config.c b/src/daemon/config/isulad_config.c
index 917e3eaa..38bf4bf9 100644
--- a/src/daemon/config/isulad_config.c
+++ b/src/daemon/config/isulad_config.c
@@ -314,7 +314,7 @@ char *conf_get_routine_rootdir(const char *runtime)
}
/* path = conf->rootpath + / + engines + / + runtime + /0 */
- if (strlen(conf->json_confs->graph) > (SIZE_MAX - strlen(ENGINE_ROOTPATH_NAME)) - 3) {
+ if (strlen(conf->json_confs->graph) > (SIZE_MAX - strlen(ENGINE_ROOTPATH_NAME) - strlen(runtime)) - 3) {
ERROR("Graph path is too long");
goto out;
}
diff --git a/src/daemon/executor/container_cb/execution_create.c b/src/daemon/executor/container_cb/execution_create.c
index cc9ae716..4cc333fd 100644
--- a/src/daemon/executor/container_cb/execution_create.c
+++ b/src/daemon/executor/container_cb/execution_create.c
@@ -533,7 +533,7 @@ static char *try_generate_id()
int i = 0;
int max_time = 10;
char *id = NULL;
- char *value = NULL;
+ container_t *value = NULL;
id = util_smart_calloc_s(sizeof(char), (CONTAINER_ID_MAX_LEN + 1));
if (id == NULL) {
@@ -547,9 +547,9 @@ static char *try_generate_id()
goto err_out;
}
- value = container_name_index_get(id);
+ value = containers_store_get(id);
if (value != NULL) {
- free(value);
+ container_unref(value);
value = NULL;
continue;
} else {
--
2.25.1
|