mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-25 04:42:20 +00:00
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>
This commit is contained in:
parent
093eed7360
commit
da61e92739
@ -193,8 +193,8 @@ static virLXCController *virLXCControllerNew(const char *name)
|
||||
|
||||
ctrl->timerShutdown = -1;
|
||||
ctrl->firstClient = true;
|
||||
|
||||
ctrl->name = g_strdup(name);
|
||||
ctrl->handshakeFd = -1;
|
||||
|
||||
if (!(driver = virLXCControllerDriverNew()))
|
||||
goto error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user