From: Peter Krempa Date: Thu, 27 Oct 2011 08:24:30 +0000 (+0200) Subject: lxc: Revert zeroing count of allocated items if VIR_REALLOC_N fails X-Git-Tag: v0.9.7-rc1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95d3b4de714049e4b6b2033e2db9151ae11d6742;p=thirdparty%2Flibvirt.git 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 --- 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;