提交 bbc663b1 编写于 作者: D Daniel P. Berrange

Fix crash free'ing securityDriverNames in QEMU driver

The previous fix to avoid leaking securityDriverNames forgot to
handle the case of securityDriverNames being NULL, leading to
a crash
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 2349d51f
......@@ -1134,7 +1134,8 @@ qemuShutdown(void) {
VIR_FREE(qemu_driver->saveImageFormat);
VIR_FREE(qemu_driver->dumpImageFormat);
for (i = 0 ; qemu_driver->securityDriverNames[i] != NULL ; i++)
for (i = 0 ; (qemu_driver->securityDriverNames != NULL &&
qemu_driver->securityDriverNames[i] != NULL) ; i++)
VIR_FREE(qemu_driver->securityDriverNames[i]);
VIR_FREE(qemu_driver->securityDriverNames);
virSecurityManagerFree(qemu_driver->securityManager);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册