From: Michal Privoznik Date: Mon, 18 Jan 2016 08:11:19 +0000 (+0100) Subject: qemuTestDriverInit: fill driver with zeroes X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7f866e54df59489b45e6635195ac8fff14e6fe8b;p=libvirt.git qemuTestDriverInit: fill driver with zeroes In the commit aea47e48c473a we have fixed a single pointer within driver structure. Since all callers pass statically allocated driver on stack other pointers within driver may contain random values too. Before touching it lets overwrite it with zeroes and thus fix all dangling pointers. Signed-off-by: Michal Privoznik --- diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index f2eacdded5..ae69a18f52 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -555,11 +555,11 @@ int qemuTestCapsCacheInsert(virQEMUCapsCachePtr cache, const char *binary, int qemuTestDriverInit(virQEMUDriver *driver) { + memset(driver, 0, sizeof(*driver)); + if (virMutexInit(&driver->lock) < 0) return -1; - driver->securityManager = NULL; - driver->config = virQEMUDriverConfigNew(false); if (!driver->config) goto error;