mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +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
This commit is contained in:
parent
2b121dbc10
commit
81efb13b4a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user