]> git.ipfire.org Git - thirdparty/libvirt.git/commit
ch: set driver to NULL after freeing it
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 4 Jun 2021 14:59:50 +0000 (15:59 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 9 Jun 2021 09:18:04 +0000 (10:18 +0100)
commitb4701fe648e3f3e3648690232c13c87a87a98e83
treef98306ffb287d3c7a1a29edc4e23f9878683794d
parent85ea510624fd6847104206f9e6ccfcd00249e755
ch: set driver to NULL after freeing it

If the chStateInitialize method fails, we call chStateCleanup
which free's all global state. It fails to set the global
'ch_driver' to NULL, however, so a later attempt to open the
cloud hypervisor driver will succeed and then crash attempting
to access freed memory.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/ch/ch_driver.c