Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
11a11812
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
11a11812
编写于
1月 14, 2013
作者:
J
John Ferlan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commandtest: Resolve some coverity resource leaks
上级
e2f1fc52
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
5 deletion
+12
-5
tests/commandtest.c
tests/commandtest.c
+12
-5
未找到文件。
tests/commandtest.c
浏览文件 @
11a11812
...
@@ -680,7 +680,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
...
@@ -680,7 +680,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
goto
cleanup
;
goto
cleanup
;
}
}
if
(
!
outbuf
||
*
outbuf
)
{
if
(
*
outbuf
)
{
puts
(
"output buffer is not an allocated empty string"
);
puts
(
"output buffer is not an allocated empty string"
);
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -702,7 +702,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
...
@@ -702,7 +702,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
goto
cleanup
;
goto
cleanup
;
}
}
if
(
!
outbuf
||
*
outbuf
||
!
err
buf
||
*
errbuf
)
{
if
(
*
out
buf
||
*
errbuf
)
{
puts
(
"output buffers are not allocated empty strings"
);
puts
(
"output buffers are not allocated empty strings"
);
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -936,6 +936,7 @@ mymain(void)
...
@@ -936,6 +936,7 @@ mymain(void)
int
fd
;
int
fd
;
virCommandTestDataPtr
test
=
NULL
;
virCommandTestDataPtr
test
=
NULL
;
int
timer
=
-
1
;
int
timer
=
-
1
;
int
virinitret
;
if
(
virThreadInitialize
()
<
0
)
if
(
virThreadInitialize
()
<
0
)
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
...
@@ -963,18 +964,21 @@ mymain(void)
...
@@ -963,18 +964,21 @@ mymain(void)
dup2
(
fd
,
6
)
<
0
||
dup2
(
fd
,
6
)
<
0
||
dup2
(
fd
,
7
)
<
0
||
dup2
(
fd
,
7
)
<
0
||
dup2
(
fd
,
8
)
<
0
||
dup2
(
fd
,
8
)
<
0
||
(
fd
>
8
&&
VIR_CLOSE
(
fd
)
<
0
))
(
fd
>
8
&&
VIR_CLOSE
(
fd
)
<
0
))
{
VIR_FORCE_CLOSE
(
fd
);
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
/* Prime the debug/verbose settings from the env vars,
/* Prime the debug/verbose settings from the env vars,
* since we're about to reset 'environ' */
* since we're about to reset 'environ' */
ignore_value
(
virTestGetDebug
());
ignore_value
(
virTestGetDebug
());
ignore_value
(
virTestGetVerbose
());
ignore_value
(
virTestGetVerbose
());
if
(
virInitialize
()
<
0
)
/* Make sure to not leak fd's */
return
EXIT_FAILURE
;
virinitret
=
virInitialize
()
;
/* Phase two of killing interfering fds; see above. */
/* Phase two of killing interfering fds; see above. */
/* coverity[overwrite_var] - silence the obvious */
fd
=
3
;
fd
=
3
;
VIR_FORCE_CLOSE
(
fd
);
VIR_FORCE_CLOSE
(
fd
);
fd
=
4
;
fd
=
4
;
...
@@ -988,6 +992,9 @@ mymain(void)
...
@@ -988,6 +992,9 @@ mymain(void)
fd
=
8
;
fd
=
8
;
VIR_FORCE_CLOSE
(
fd
);
VIR_FORCE_CLOSE
(
fd
);
if
(
virinitret
<
0
)
return
EXIT_FAILURE
;
virEventRegisterDefaultImpl
();
virEventRegisterDefaultImpl
();
if
(
VIR_ALLOC
(
test
)
<
0
)
{
if
(
VIR_ALLOC
(
test
)
<
0
)
{
virReportOOMError
();
virReportOOMError
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录