mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
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>
This commit is contained in:
parent
85ea510624
commit
b4701fe648
@ -827,6 +827,7 @@ static int chStateCleanup(void)
|
||||
virObjectUnref(ch_driver->config);
|
||||
virMutexDestroy(&ch_driver->lock);
|
||||
g_free(ch_driver);
|
||||
ch_driver = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user