提交 0bbeafc7 编写于 作者: D Daniel P. Berrange

Avoid uninitialized data in qemuMonitorTestNew

The virDomainChrSourceDef variable should be memset to
0, so that the cleanup block does not free uninitialized
data on OOM.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 9129f9b3
......@@ -878,6 +878,8 @@ qemuMonitorTestNew(bool json,
qemuMonitorTestPtr test = NULL;
virDomainChrSourceDef src;
memset(&src, 0, sizeof(src));
if (!(test = qemuMonitorCommonTestNew(xmlopt, vm, &src)))
goto error;
......@@ -915,6 +917,8 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt)
qemuMonitorTestPtr test = NULL;
virDomainChrSourceDef src;
memset(&src, 0, sizeof(src));
if (!(test = qemuMonitorCommonTestNew(xmlopt, NULL, &src)))
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册