From: Daniel P. Berrange Date: Wed, 25 Sep 2013 08:35:29 +0000 (+0100) Subject: Don't clobber 'ret' in LXC XML test case X-Git-Tag: v1.1.3-rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3debed1bbd582da457f0ee4fc55b56c4c1928889;p=thirdparty%2Flibvirt.git Don't clobber 'ret' in LXC XML test case The testCompareXMLToXMLHelper method clobbered the 'ret' variable in several places leading to a failure to report OOM errors from the test suite. Signed-off-by: Daniel P. Berrange --- diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index ca05d291f7..aeb394085c 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -79,18 +79,23 @@ testCompareXMLToXMLHelper(const void *data) goto cleanup; if (info->different) { - ret = testCompareXMLToXMLFiles(xml_in, xml_out, false); + if (testCompareXMLToXMLFiles(xml_in, xml_out, false) < 0) + goto cleanup; } else { - ret = testCompareXMLToXMLFiles(xml_in, xml_in, false); + if (testCompareXMLToXMLFiles(xml_in, xml_in, false) < 0) + goto cleanup; } if (!info->inactive_only) { if (info->different) { - ret = testCompareXMLToXMLFiles(xml_in, xml_out, true); + if (testCompareXMLToXMLFiles(xml_in, xml_out, true) < 0) + goto cleanup; } else { - ret = testCompareXMLToXMLFiles(xml_in, xml_in, true); + if (testCompareXMLToXMLFiles(xml_in, xml_in, true) < 0) + goto cleanup; } } + ret = 0; cleanup: VIR_FREE(xml_in); VIR_FREE(xml_out);