mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-16 17:45:16 +00:00
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 81efb13b4a33f58c28e0e65dcc9521b983592683)
This commit is contained in:
parent
89cecbbecc
commit
fac1a19dfc
@ -1649,6 +1649,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virPidFileDelete(LXC_STATE_DIR, name);
|
virPidFileDelete(LXC_STATE_DIR, name);
|
||||||
|
if (ctrl)
|
||||||
virLXCControllerDeleteInterfaces(ctrl);
|
virLXCControllerDeleteInterfaces(ctrl);
|
||||||
for (i = 0 ; i < nttyFDs ; i++)
|
for (i = 0 ; i < nttyFDs ; i++)
|
||||||
VIR_FORCE_CLOSE(ttyFDs[i]);
|
VIR_FORCE_CLOSE(ttyFDs[i]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user