cpu_x86: Fix memory leak - virCPUx86GetHost

Commit 56b254dcc called virCPUx86DataAdd, but returned -1 directly
without calling the virCPUx86DataFree.

Found by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
John Ferlan 2019-06-21 13:07:15 -04:00
parent 0a5a547725
commit 5acb4eede2

View File

@ -2791,7 +2791,7 @@ virCPUx86GetHost(virCPUDefPtr cpu,
};
if (virCPUx86DataAdd(cpuData, &item) < 0)
return -1;
goto cleanup;
}
}