mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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:
parent
9129f9b3f1
commit
0bbeafc768
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user