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: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-09-25 15:30:27 +01:00
parent 9129f9b3f1
commit 0bbeafc768

View File

@ -878,6 +878,8 @@ qemuMonitorTestNew(bool json,
qemuMonitorTestPtr test = NULL; qemuMonitorTestPtr test = NULL;
virDomainChrSourceDef src; virDomainChrSourceDef src;
memset(&src, 0, sizeof(src));
if (!(test = qemuMonitorCommonTestNew(xmlopt, vm, &src))) if (!(test = qemuMonitorCommonTestNew(xmlopt, vm, &src)))
goto error; goto error;
@ -915,6 +917,8 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt)
qemuMonitorTestPtr test = NULL; qemuMonitorTestPtr test = NULL;
virDomainChrSourceDef src; virDomainChrSourceDef src;
memset(&src, 0, sizeof(src));
if (!(test = qemuMonitorCommonTestNew(xmlopt, NULL, &src))) if (!(test = qemuMonitorCommonTestNew(xmlopt, NULL, &src)))
goto error; goto error;