Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
550c7767
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
550c7767
编写于
3月 07, 2020
作者:
L
LiFeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iSulad: fix wrong use of util_free_arry
Signed-off-by:
N
LiFeng
<
lifeng68@huawei.com
>
上级
65ddd0fd
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
29 addition
and
26 deletion
+29
-26
src/cmd/isulad/arguments.c
src/cmd/isulad/arguments.c
+1
-1
src/connect/client/isula_image_connect.c
src/connect/client/isula_image_connect.c
+3
-3
src/libisula.c
src/libisula.c
+11
-11
src/services/execution/events/collector.c
src/services/execution/events/collector.c
+1
-1
src/services/execution/execute/execution_information.c
src/services/execution/execute/execution_information.c
+10
-7
src/services/execution/spec/specs_mount.c
src/services/execution/spec/specs_mount.c
+3
-3
未找到文件。
src/cmd/isulad/arguments.c
浏览文件 @
550c7767
...
...
@@ -180,7 +180,7 @@ void service_arguments_free(struct service_arguments *args)
free
(
args
->
logpath
);
args
->
logpath
=
NULL
;
util_free_array
(
args
->
hosts
);
util_free_array
_by_len
(
args
->
hosts
,
args
->
hosts_len
);
args
->
hosts
=
NULL
;
args
->
hosts_len
=
0
;
...
...
src/connect/client/isula_image_connect.c
浏览文件 @
550c7767
...
...
@@ -97,7 +97,7 @@ void free_isula_prepare_request(struct isula_prepare_request *req)
req
->
name
=
NULL
;
free
(
req
->
image
);
req
->
image
=
NULL
;
util_free_array
(
req
->
storage_opts
);
util_free_array
_by_len
(
req
->
storage_opts
,
req
->
storage_opts_len
);
req
->
storage_opts
=
NULL
;
req
->
storage_opts_len
=
0
;
free
(
req
);
...
...
@@ -210,10 +210,10 @@ void free_image_metadata(struct image_metadata *data)
}
free
(
data
->
id
);
data
->
id
=
NULL
;
util_free_array
(
data
->
repo_tags
);
util_free_array
_by_len
(
data
->
repo_tags
,
data
->
repo_tags_len
);
data
->
repo_tags
=
NULL
;
data
->
repo_tags_len
=
0
;
util_free_array
(
data
->
repo_digests
);
util_free_array
_by_len
(
data
->
repo_digests
,
data
->
repo_digests_len
);
data
->
repo_digests
=
NULL
;
data
->
repo_digests_len
=
0
;
free
(
data
->
username
);
...
...
src/libisula.c
浏览文件 @
550c7767
...
...
@@ -220,7 +220,7 @@ void isula_ns_change_files_free(isula_host_config_t *hostconfig)
return
;
}
util_free_array
(
hostconfig
->
ns_change_files
);
util_free_array
_by_len
(
hostconfig
->
ns_change_files
,
hostconfig
->
ns_change_files_len
);
hostconfig
->
ns_change_files
=
NULL
;
hostconfig
->
ns_change_files_len
=
0
;
}
...
...
@@ -252,11 +252,11 @@ void isula_host_config_free(isula_host_config_t *hostconfig)
return
;
}
util_free_array
(
hostconfig
->
cap_add
);
util_free_array
_by_len
(
hostconfig
->
cap_add
,
hostconfig
->
cap_add_len
);
hostconfig
->
cap_add
=
NULL
;
hostconfig
->
cap_add_len
=
0
;
util_free_array
(
hostconfig
->
cap_drop
);
util_free_array
_by_len
(
hostconfig
->
cap_drop
,
hostconfig
->
cap_drop_len
);
hostconfig
->
cap_drop
=
NULL
;
hostconfig
->
cap_drop_len
=
0
;
...
...
@@ -266,11 +266,11 @@ void isula_host_config_free(isula_host_config_t *hostconfig)
free_json_map_string_string
(
hostconfig
->
sysctls
);
hostconfig
->
sysctls
=
NULL
;
util_free_array
(
hostconfig
->
devices
);
util_free_array
_by_len
(
hostconfig
->
devices
,
hostconfig
->
devices_len
);
hostconfig
->
devices
=
NULL
;
hostconfig
->
devices_len
=
0
;
util_free_array
(
hostconfig
->
hugetlbs
);
util_free_array
_by_len
(
hostconfig
->
hugetlbs
,
hostconfig
->
hugetlbs_len
);
hostconfig
->
hugetlbs
=
NULL
;
hostconfig
->
hugetlbs_len
=
0
;
...
...
@@ -292,7 +292,7 @@ void isula_host_config_free(isula_host_config_t *hostconfig)
free
(
hostconfig
->
user_remap
);
hostconfig
->
user_remap
=
NULL
;
util_free_array
(
hostconfig
->
ulimits
);
util_free_array
_by_len
(
hostconfig
->
ulimits
,
hostconfig
->
ulimits_len
);
hostconfig
->
ulimits
=
NULL
;
hostconfig
->
ulimits_len
=
0
;
...
...
@@ -311,11 +311,11 @@ void isula_host_config_free(isula_host_config_t *hostconfig)
free
(
hostconfig
->
cgroup_parent
);
hostconfig
->
cgroup_parent
=
NULL
;
util_free_array
(
hostconfig
->
binds
);
util_free_array
_by_len
(
hostconfig
->
binds
,
hostconfig
->
binds_len
);
hostconfig
->
binds
=
NULL
;
hostconfig
->
binds_len
=
0
;
util_free_array
(
hostconfig
->
blkio_weight_device
);
util_free_array
_by_len
(
hostconfig
->
blkio_weight_device
,
hostconfig
->
blkio_weight_device_len
);
hostconfig
->
blkio_weight_device
=
NULL
;
hostconfig
->
blkio_weight_device_len
=
0
;
...
...
@@ -332,7 +332,7 @@ void isula_container_config_free(isula_container_config_t *config)
return
;
}
util_free_array
(
config
->
env
);
util_free_array
_by_len
(
config
->
env
,
config
->
env_len
);
config
->
env
=
NULL
;
config
->
env_len
=
0
;
...
...
@@ -342,11 +342,11 @@ void isula_container_config_free(isula_container_config_t *config)
free
(
config
->
user
);
config
->
user
=
NULL
;
util_free_array
(
config
->
mounts
);
util_free_array
_by_len
(
config
->
mounts
,
config
->
mounts_len
);
config
->
mounts
=
NULL
;
config
->
mounts_len
=
0
;
util_free_array
(
config
->
cmd
);
util_free_array
_by_len
(
config
->
cmd
,
config
->
cmd_len
);
config
->
cmd
=
NULL
;
config
->
cmd_len
=
0
;
...
...
src/services/execution/events/collector.c
浏览文件 @
550c7767
src/services/execution/execute/execution_information.c
浏览文件 @
550c7767
...
...
@@ -450,7 +450,8 @@ out:
return
ret
;
}
int
parse_output
(
char
**
title
,
char
***
process
,
const
char
*
output
,
const
pid_t
*
pids
,
size_t
pids_len
)
int
parse_output
(
char
**
title
,
char
***
process
,
size_t
*
process_len
,
const
char
*
output
,
const
pid_t
*
pids
,
size_t
pids_len
)
{
int
ret
=
0
;
int
pid_num
=
0
;
...
...
@@ -479,6 +480,7 @@ int parse_output(char **title, char ***process, const char *output, const pid_t
}
ret
=
parse_output_by_lines
(
*
process
,
tmp
,
pid_num
,
stime
,
pids
,
pids_len
);
*
process_len
=
util_array_len
((
const
char
**
)(
*
process
));
out:
util_free_array
(
tmp
);
...
...
@@ -755,6 +757,7 @@ static int container_top_cb(container_top_request *request, container_top_respon
char
*
stderr_buffer
=
NULL
;
char
*
titles
=
NULL
;
char
**
processes
=
NULL
;
size_t
process_len
=
0
;
pid_t
*
pids
=
NULL
;
size_t
pids_len
=
0
;
container_t
*
cont
=
NULL
;
...
...
@@ -792,17 +795,17 @@ static int container_top_cb(container_top_request *request, container_top_respon
goto
pack_response
;
}
if
(
parse_output
(
&
titles
,
&
processes
,
stdout_buffer
,
pids
,
pids_len
))
{
if
(
parse_output
(
&
titles
,
&
processes
,
&
process_len
,
stdout_buffer
,
pids
,
pids_len
))
{
ERROR
(
"Failed to parse output!"
);
cc
=
ISULAD_ERR_EXEC
;
goto
pack_response
;
}
if
(
util_array_len
((
const
char
**
)
processes
)
>
SIZE_MAX
/
sizeof
(
char
*
))
{
if
(
process_len
>
SIZE_MAX
/
sizeof
(
char
*
))
{
ERROR
(
"invalid processe size"
);
cc
=
ISULAD_ERR_EXEC
;
goto
pack_response
;
}
(
*
response
)
->
processes
=
util_common_calloc_s
(
util_array_len
((
const
char
**
)
processes
)
*
sizeof
(
char
*
));
(
*
response
)
->
processes
=
util_common_calloc_s
(
process_len
*
sizeof
(
char
*
));
if
((
*
response
)
->
processes
==
NULL
)
{
ERROR
(
"Out of memory"
);
cc
=
ISULAD_ERR_EXEC
;
...
...
@@ -811,10 +814,10 @@ static int container_top_cb(container_top_request *request, container_top_respon
(
*
response
)
->
titles
=
titles
;
titles
=
NULL
;
for
(
i
=
0
;
i
<
util_array_len
((
const
char
**
)
processes
)
;
i
++
)
{
for
(
i
=
0
;
i
<
process_len
;
i
++
)
{
(
*
response
)
->
processes
[
i
]
=
util_strdup_s
(
processes
[
i
]);
}
(
*
response
)
->
processes_len
=
util_array_len
((
const
char
**
)
processes
)
;
(
*
response
)
->
processes_len
=
process_len
;
(
void
)
isulad_monitor_send_container_event
(
id
,
TOP
,
-
1
,
0
,
NULL
,
NULL
);
pack_response:
...
...
@@ -830,7 +833,7 @@ pack_response:
stderr_buffer
=
NULL
;
free
(
pid_args
);
free
(
titles
);
util_free_array
(
processes
);
util_free_array
_by_len
(
processes
,
process_len
);
free_log_prefix
();
DAEMON_CLEAR_ERRMSG
();
return
(
cc
==
ISULAD_SUCCESS
)
?
0
:
-
1
;
...
...
src/services/execution/spec/specs_mount.c
浏览文件 @
550c7767
...
...
@@ -1874,7 +1874,7 @@ static bool mount_file(oci_runtime_spec *container, const char *src_path, const
out_free:
if
(
!
ret
)
{
util_free_array
(
options
);
util_free_array
_by_len
(
options
,
options_len
);
free_defs_mount
(
tmp_mounts
);
}
return
ret
;
...
...
@@ -1924,7 +1924,7 @@ static bool add_host_channel_mount(oci_runtime_spec *container, const host_confi
out_free:
if
(
!
ret
)
{
util_free_array
(
options
);
util_free_array
_by_len
(
options
,
options_len
);
free_defs_mount
(
tmp_mounts
);
}
return
ret
;
...
...
@@ -2261,7 +2261,7 @@ static bool add_shm_mount(oci_runtime_spec *container, const char *shm_path)
out_free:
if
(
!
ret
)
{
util_free_array
(
options
);
util_free_array
_by_len
(
options
,
options_len
);
free_defs_mount
(
tmp_mounts
);
}
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录