]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuhotplugtest: Free monitor iff successfully initialized
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 27 Jun 2020 07:20:21 +0000 (09:20 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 29 Jun 2020 10:38:22 +0000 (12:38 +0200)
commitb150fbc4fe97b823707b7433dfb37e4f2f5b685e
tree4295e27096b4e96c415a3333895a1e9c2656b592
parentd482cf6bef484e697f1dbb99f2504e7d67b149e7
qemuhotplugtest: Free monitor iff successfully initialized

If initializing test monitor in testQemuHotplugCpuPrepare()
fails, the control jumps to error label where
testQemuHotplugCpuDataFree() is called. But since the data->mon
is NULL due to aforementioned failure,
qemuMonitorTestGetMonitor() dereferences a NULL pointer leading
to a SIGSEGV.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tests/qemuhotplugtest.c