qemu: Fix leak in qemuProcessInitCpuAffinity()
commit2f2254c7f4e5bff52ea62a77831230bebc076bab
authorAndrea Bolognani <abologna@redhat.com>
Tue, 4 Jun 2019 12:36:21 +0000 (4 14:36 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 4 Jun 2019 13:53:51 +0000 (4 15:53 +0200)
tree8a592d7f94739edd507ac116f73d8ac0407d7ce7
parentb34fb1fb6f99628932ad68db1ce4985a06def17f
qemu: Fix leak in qemuProcessInitCpuAffinity()

In two out of three scenarios we are cleaning up properly after
ourselves, but commit 5f2212c062c7 has changed the remaining one
in a way that caused it to start leaking cpumapToSet.

Refactor the logic so that cpumapToSet is always a freshly
allocated bitmap that gets cleaned up automatically thanks to
VIR_AUTOPTR(); this also allows us to remove the hostcpumap
variable.

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c