]> git.ipfire.org Git - thirdparty/libvirt.git/commit
esx: Fix double-free and freeing static strings in esxDomainSetAutostart
authorMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 2 Aug 2018 15:33:37 +0000 (17:33 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 2 Aug 2018 19:06:19 +0000 (21:06 +0200)
commit3ad77f853230f870efa396636e008292c7f2b1c0
treea769a08722dbe8f87fb534d8da03648135a43f7a
parent3e8703368b786162f6b53c464218bbf61717f924
esx: Fix double-free and freeing static strings in esxDomainSetAutostart

Since commit ae83e02f3dd7fe99fed5d8159a35b666fafeafd5#l3393 the
newPowerInfo pointer itself is used to track the ownership of the
AutoStartPowerInfo object to make Coverity understand the code better.
This broke the code that unset some members of the AutoStartPowerInfo
object that should not be freed the normal way.

Instead, transfer ownership of the AutoStartPowerInfo object to the
HostAutoStartManagerConfig object before filling in the values that
need special handling. This allows to free the AutoStartPowerInfo
directly without having to deal with the special values, or to let
the old (now restored) logic handle the special values again.

Signed-off-by: Matthias Bolte <matthias.bolte@googlemail.com>
Tested-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/esx/esx_driver.c