提交 7f866e54 编写于 作者: M Michal Privoznik

qemuTestDriverInit: fill driver with zeroes

In the commit aea47e48 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: NMichal Privoznik <mprivozn@redhat.com>
上级 9d7e20d1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册