Fix qemu-nbd cleanup crashes

The virLXCControllerAppendNBDPids function didn't properly initialize
pids and npids. In case of failure it was crashing when freeing those.
This commit is contained in:
Cédric Bosdonnat 2015-07-15 09:58:18 +02:00
parent aa6c3fee86
commit 8dd8df6f7c

View File

@ -533,8 +533,8 @@ static int virLXCControllerAppendNBDPids(virLXCControllerPtr ctrl,
const char *dev)
{
char *pidpath = NULL;
pid_t *pids;
size_t npids;
pid_t *pids = NULL;
size_t npids = 0;
size_t i;
int ret = -1;
pid_t pid;