提交 c4b32641 编写于 作者: P Peter Krempa

qemu: Avoid dereference of NULL pointer

If something fails while initializing qemu job object in
qemuDomainObjPrivateAlloc(), memory to the private pointer is freed, but
after that, the pointer is still dereferenced, which may result in a
segfault.

* qemuDomainObjPrivateAlloc() - Don't dereference NULL pointer.
上级 db2f6807
......@@ -214,11 +214,15 @@ static void *qemuDomainObjPrivateAlloc(void)
return NULL;
if (qemuDomainObjInitJob(priv) < 0)
VIR_FREE(priv);
goto error;
priv->migMaxBandwidth = QEMU_DOMAIN_DEFAULT_MIG_BANDWIDTH_MAX;
return priv;
error:
VIR_FREE(priv);
return NULL;
}
static void qemuDomainObjPrivateFree(void *data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册