From 95d3b4de714049e4b6b2033e2db9151ae11d6742 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 27 Oct 2011 10:24:30 +0200 Subject: [PATCH] lxc: Revert zeroing count of allocated items if VIR_REALLOC_N fails Previous commit clears number of items alocated in lxcSetupLoopDevices if VIR_REALLOC_N fails. In that case, the pointer is not NULL, and causes leaking FDs that have been allocated. * src/lxc/lxc_controller.c: revert zeroing array size --- src/lxc/lxc_controller.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 7603bc7e89..024756d4a9 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -208,7 +208,6 @@ static int lxcSetupLoopDevices(virDomainDefPtr def, size_t *nloopDevs, int **loo VIR_DEBUG("Saving loop fd %d", fd); if (VIR_REALLOC_N(*loopDevs, *nloopDevs+1) < 0) { - *nloopDevs = 0; VIR_FORCE_CLOSE(fd); virReportOOMError(); goto cleanup;