testutilsxen: Avoid double free of driver caps

In testXLInitDriver() a dummy driver structure is filled and it
is freed later in testXLFreeDriver(). However, it is sufficient
to unref just driver->config because that results in
libxlDriverConfigDispose() being called which unrefs
driver->config->caps. There is no need to unref it again in
testXLFreeDriver() - in fact it's undesired.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Michal Privoznik 2019-12-11 10:17:30 +01:00
parent 08a7e88b6f
commit 98f1f4a439

View File

@ -105,7 +105,6 @@ libxlDriverPrivatePtr testXLInitDriver(void)
void testXLFreeDriver(libxlDriverPrivatePtr driver)
{
virObjectUnref(driver->config->caps);
virObjectUnref(driver->config);
virObjectUnref(driver->xmlopt);
virMutexDestroy(&driver->lock);