]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxc_controller: Initialize ctrl->handshakeFd properly
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Apr 2021 08:36:09 +0000 (10:36 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 22 Apr 2021 11:52:21 +0000 (13:52 +0200)
commitda61e92739b16bb9403f94b5a5e64fe728d7bbe9
treef3d77d0ba3b7325f25099da33ade86a27d7666de
parent093eed7360101a607ba024ccdbe54098322ce0f3
lxc_controller: Initialize ctrl->handshakeFd properly

The lxc_controller has a structure that's keeping its internal
state, including so called handshakeFd which is the write end of
a pipe that's used to signal to the LXC driver that the container
is set up and ready to run. However, the struct member is not
initialized to -1, so if anything fails before it is set then the
virLXCControllerFree() function tries to close FD 0 (stdin).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/lxc/lxc_controller.c