mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
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
This commit is contained in:
parent
838d8c1b6b
commit
95d3b4de71
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user