
27 Jan
2016
27 Jan
'16
5:46 p.m.
On Tue, 2016-01-26 at 18:58 -0500, John Ferlan wrote:
- while (virPCIDeviceListCount(pcidevs) > 0) - virPCIDeviceListStealIndex(pcidevs, 0); - Hmmm.. interesting looks like this would have been a memory leak since
the code ignoree the return.... Normal when *Steal is called from *ListDel, a *DeviceFree is called on the returned stolen device.
I don't think it was, because earlier on the devices in 'pcidevs' are added, not copied, to the active list. So stealing all of them from 'pcidevs' here is a way to prevent 'virObjectUnref(pcidevs)' in the cleanup part to free the memory associated with them Cheers. -- Andrea Bolognani Software Engineer - Virtualization Team