From 0bbeafc768e1928f89c9ab43d9693e6a92591424 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 25 Sep 2013 15:30:27 +0100 Subject: [PATCH] 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 --- tests/qemumonitortestutils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 956847667c..bca338541c 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -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; -- GitLab