From 8dd8df6f7ce8f606d0e344d5db7bc974cd2771ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Wed, 15 Jul 2015 09:58:18 +0200 Subject: [PATCH] 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. --- src/lxc/lxc_controller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 27e2e3a85a..c73bb4f580 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -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; -- GitLab