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:
Daniel P. Berrange 2013-09-24 16:09:36 +01:00
parent 386ebb47a5
commit fbf8e1c314

View File

@ -1854,7 +1854,7 @@ virDomainVcpuPinDefArrayFree(virDomainVcpuPinDefPtr *def,
{
size_t i;
if (!def || !nvcpupin)
if (!def)
return;
for (i = 0; i < nvcpupin; i++) {