]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix mem leak in virQEMUCapsProbeQMPMachineTypes on OOM
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 6 Nov 2013 07:30:16 +0000 (15:30 +0800)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 12 Nov 2013 10:47:30 +0000 (10:47 +0000)
commitf41830680e40d3ec845cefd25419bd87414b9ccf
tree8b35804298d33fe69c3935a9d9d8dace0944551c
parentc2986ff0d3da47f26e356fd12310fc032be1c7a5
Fix mem leak in virQEMUCapsProbeQMPMachineTypes on OOM

The virQEMUCapsProbeQMPMachineTypes method iterates over machine
types copying them into the qemuCapsPtr object. It only updates
the qemuCaps->nmachinetypes value at the end though. So if OOM
occurs in the middle, the destructor of qemuCapsPtr will not
free the partially initialized machine types.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_capabilities.c