mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-07 04:07:17 +00:00
tests: libxl: Fix a segfault when libxl configuration setup fails
This commit fixes a segmentation fault caused by missing conditional to check if libxl configuration was properly created by the test. If the configuration was not properly created, libxlDriverConfigNew() function will return NULL and cause a segfault at cfg->caps = NULL during the cleanup. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
3c73beebca
commit
8e09f9afc7
@ -138,7 +138,8 @@ testCompareXMLToDomConfig(const char *xmlfile,
|
||||
libxl_domain_config_dispose(&actualconfig);
|
||||
libxl_domain_config_dispose(&expectconfig);
|
||||
xtl_logger_destroy(log);
|
||||
cfg->caps = NULL;
|
||||
if (cfg)
|
||||
cfg->caps = NULL;
|
||||
virObjectUnref(cfg);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user