提交 fac1a19d 编写于 作者: P Peter Krempa 提交者: Cole Robinson

lxc: Avoid segfault of libvirt_lxc helper on early cleanup paths

Early jumps to the cleanup label caused a crash of the libvirt_lxc
container helper as the cleanup section called
virLXCControllerDeleteInterfaces(ctrl) without checking the ctrl argument
for NULL. The argument was de-referenced soon after.

$ /usr/libexec/libvirt_lxc
/usr/libexec/libvirt_lxc: missing --name argument for configuration
Segmentation fault
(cherry picked from commit 81efb13b)
上级 89cecbbe
......@@ -1649,7 +1649,8 @@ int main(int argc, char *argv[])
cleanup:
virPidFileDelete(LXC_STATE_DIR, name);
virLXCControllerDeleteInterfaces(ctrl);
if (ctrl)
virLXCControllerDeleteInterfaces(ctrl);
for (i = 0 ; i < nttyFDs ; i++)
VIR_FORCE_CLOSE(ttyFDs[i]);
VIR_FREE(ttyFDs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册