mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
Fix leak in virDomainVcpuPinDefArrayFree
If virDomainVcpuPinDefArrayFree is called with def != NULL, but nvcpupin == 0, then it leaks memory for 'def'. This is an unusual scenario, but it hits when cleaning up after an OOM during parsing of XML. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
386ebb47a5
commit
fbf8e1c314
@ -1854,7 +1854,7 @@ virDomainVcpuPinDefArrayFree(virDomainVcpuPinDefPtr *def,
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!def || !nvcpupin)
|
if (!def)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < nvcpupin; i++) {
|
for (i = 0; i < nvcpupin; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user