Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
ab96c35a
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ab96c35a
编写于
3月 29, 2019
作者:
J
Ján Tomko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virsh-completer: use VIR_AUTOFREE for xmlNodePtr* variables
Signed-off-by:
N
Ján Tomko
<
jtomko@redhat.com
>
上级
d46dd75e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
6 addition
and
12 deletion
+6
-12
tools/virsh-completer.c
tools/virsh-completer.c
+6
-12
未找到文件。
tools/virsh-completer.c
浏览文件 @
ab96c35a
...
@@ -128,7 +128,7 @@ virshDomainInterfaceCompleter(vshControl *ctl,
...
@@ -128,7 +128,7 @@ virshDomainInterfaceCompleter(vshControl *ctl,
xmlDocPtr
xmldoc
=
NULL
;
xmlDocPtr
xmldoc
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
int
ninterfaces
;
int
ninterfaces
;
xmlNodePtr
*
interfaces
=
NULL
;
VIR_AUTOFREE
(
xmlNodePtr
*
)
interfaces
=
NULL
;
size_t
i
;
size_t
i
;
unsigned
int
domainXMLFlags
=
0
;
unsigned
int
domainXMLFlags
=
0
;
char
**
ret
=
NULL
;
char
**
ret
=
NULL
;
...
@@ -167,7 +167,6 @@ virshDomainInterfaceCompleter(vshControl *ctl,
...
@@ -167,7 +167,6 @@ virshDomainInterfaceCompleter(vshControl *ctl,
VIR_STEAL_PTR
(
ret
,
tmp
);
VIR_STEAL_PTR
(
ret
,
tmp
);
cleanup:
cleanup:
VIR_FREE
(
interfaces
);
xmlFreeDoc
(
xmldoc
);
xmlFreeDoc
(
xmldoc
);
xmlXPathFreeContext
(
ctxt
);
xmlXPathFreeContext
(
ctxt
);
return
ret
;
return
ret
;
...
@@ -182,7 +181,7 @@ virshDomainDiskTargetCompleter(vshControl *ctl,
...
@@ -182,7 +181,7 @@ virshDomainDiskTargetCompleter(vshControl *ctl,
virshControlPtr
priv
=
ctl
->
privData
;
virshControlPtr
priv
=
ctl
->
privData
;
xmlDocPtr
xmldoc
=
NULL
;
xmlDocPtr
xmldoc
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
xmlNodePtr
*
disks
=
NULL
;
VIR_AUTOFREE
(
xmlNodePtr
*
)
disks
=
NULL
;
int
ndisks
;
int
ndisks
;
size_t
i
;
size_t
i
;
VIR_AUTOSTRINGLIST
tmp
=
NULL
;
VIR_AUTOSTRINGLIST
tmp
=
NULL
;
...
@@ -211,7 +210,6 @@ virshDomainDiskTargetCompleter(vshControl *ctl,
...
@@ -211,7 +210,6 @@ virshDomainDiskTargetCompleter(vshControl *ctl,
VIR_STEAL_PTR
(
ret
,
tmp
);
VIR_STEAL_PTR
(
ret
,
tmp
);
cleanup:
cleanup:
VIR_FREE
(
disks
);
xmlFreeDoc
(
xmldoc
);
xmlFreeDoc
(
xmldoc
);
xmlXPathFreeContext
(
ctxt
);
xmlXPathFreeContext
(
ctxt
);
return
ret
;
return
ret
;
...
@@ -665,7 +663,7 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl,
...
@@ -665,7 +663,7 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl,
xmlXPathContextPtr
ctxt
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
virshControlPtr
priv
=
ctl
->
privData
;
virshControlPtr
priv
=
ctl
->
privData
;
unsigned
int
npages
=
0
;
unsigned
int
npages
=
0
;
xmlNodePtr
*
pages
=
NULL
;
VIR_AUTOFREE
(
xmlNodePtr
*
)
pages
=
NULL
;
xmlDocPtr
doc
=
NULL
;
xmlDocPtr
doc
=
NULL
;
double
size
=
0
;
double
size
=
0
;
size_t
i
=
0
;
size_t
i
=
0
;
...
@@ -725,7 +723,6 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl,
...
@@ -725,7 +723,6 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl,
cleanup:
cleanup:
xmlXPathFreeContext
(
ctxt
);
xmlXPathFreeContext
(
ctxt
);
VIR_FREE
(
pages
);
xmlFreeDoc
(
doc
);
xmlFreeDoc
(
doc
);
VIR_FREE
(
path
);
VIR_FREE
(
path
);
VIR_FREE
(
pagesize
);
VIR_FREE
(
pagesize
);
...
@@ -838,7 +835,7 @@ virshDomainInterfaceStateCompleter(vshControl *ctl,
...
@@ -838,7 +835,7 @@ virshDomainInterfaceStateCompleter(vshControl *ctl,
virMacAddr
macaddr
;
virMacAddr
macaddr
;
char
macstr
[
VIR_MAC_STRING_BUFLEN
]
=
""
;
char
macstr
[
VIR_MAC_STRING_BUFLEN
]
=
""
;
int
ninterfaces
;
int
ninterfaces
;
xmlNodePtr
*
interfaces
=
NULL
;
VIR_AUTOFREE
(
xmlNodePtr
*
)
interfaces
=
NULL
;
char
*
xpath
=
NULL
;
char
*
xpath
=
NULL
;
char
*
state
=
NULL
;
char
*
state
=
NULL
;
VIR_AUTOSTRINGLIST
tmp
=
NULL
;
VIR_AUTOSTRINGLIST
tmp
=
NULL
;
...
@@ -888,7 +885,6 @@ virshDomainInterfaceStateCompleter(vshControl *ctl,
...
@@ -888,7 +885,6 @@ virshDomainInterfaceStateCompleter(vshControl *ctl,
cleanup:
cleanup:
VIR_FREE
(
state
);
VIR_FREE
(
state
);
VIR_FREE
(
xpath
);
VIR_FREE
(
xpath
);
VIR_FREE
(
interfaces
);
xmlXPathFreeContext
(
ctxt
);
xmlXPathFreeContext
(
ctxt
);
xmlFreeDoc
(
xml
);
xmlFreeDoc
(
xml
);
return
ret
;
return
ret
;
...
@@ -935,7 +931,7 @@ virshCellnoCompleter(vshControl *ctl,
...
@@ -935,7 +931,7 @@ virshCellnoCompleter(vshControl *ctl,
xmlXPathContextPtr
ctxt
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
virshControlPtr
priv
=
ctl
->
privData
;
virshControlPtr
priv
=
ctl
->
privData
;
unsigned
int
ncells
=
0
;
unsigned
int
ncells
=
0
;
xmlNodePtr
*
cells
=
NULL
;
VIR_AUTOFREE
(
xmlNodePtr
*
)
cells
=
NULL
;
xmlDocPtr
doc
=
NULL
;
xmlDocPtr
doc
=
NULL
;
size_t
i
=
0
;
size_t
i
=
0
;
char
*
cap_xml
=
NULL
;
char
*
cap_xml
=
NULL
;
...
@@ -969,7 +965,6 @@ virshCellnoCompleter(vshControl *ctl,
...
@@ -969,7 +965,6 @@ virshCellnoCompleter(vshControl *ctl,
cleanup:
cleanup:
xmlXPathFreeContext
(
ctxt
);
xmlXPathFreeContext
(
ctxt
);
VIR_FREE
(
cells
);
xmlFreeDoc
(
doc
);
xmlFreeDoc
(
doc
);
VIR_FREE
(
cap_xml
);
VIR_FREE
(
cap_xml
);
return
ret
;
return
ret
;
...
@@ -988,7 +983,7 @@ virshDomainDeviceAliasCompleter(vshControl *ctl,
...
@@ -988,7 +983,7 @@ virshDomainDeviceAliasCompleter(vshControl *ctl,
xmlDocPtr
xmldoc
=
NULL
;
xmlDocPtr
xmldoc
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
xmlXPathContextPtr
ctxt
=
NULL
;
int
naliases
;
int
naliases
;
xmlNodePtr
*
aliases
=
NULL
;
VIR_AUTOFREE
(
xmlNodePtr
*
)
aliases
=
NULL
;
size_t
i
;
size_t
i
;
unsigned
int
domainXMLFlags
=
0
;
unsigned
int
domainXMLFlags
=
0
;
char
**
ret
=
NULL
;
char
**
ret
=
NULL
;
...
@@ -1019,7 +1014,6 @@ virshDomainDeviceAliasCompleter(vshControl *ctl,
...
@@ -1019,7 +1014,6 @@ virshDomainDeviceAliasCompleter(vshControl *ctl,
VIR_STEAL_PTR
(
ret
,
tmp
);
VIR_STEAL_PTR
(
ret
,
tmp
);
cleanup:
cleanup:
VIR_FREE
(
aliases
);
xmlFreeDoc
(
xmldoc
);
xmlFreeDoc
(
xmldoc
);
xmlXPathFreeContext
(
ctxt
);
xmlXPathFreeContext
(
ctxt
);
return
ret
;
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录