提交 81efb13b 编写于 作者: P Peter Krempa

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
上级 2b121dbc
......@@ -1672,7 +1672,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.
先完成此消息的编辑!
想要评论请 注册