提交 8e09f9af 编写于 作者: J Julio Faracco 提交者: Erik Skultety

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: NJulio Faracco <jcfaracco@gmail.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 3c73beeb
...@@ -138,7 +138,8 @@ testCompareXMLToDomConfig(const char *xmlfile, ...@@ -138,7 +138,8 @@ testCompareXMLToDomConfig(const char *xmlfile,
libxl_domain_config_dispose(&actualconfig); libxl_domain_config_dispose(&actualconfig);
libxl_domain_config_dispose(&expectconfig); libxl_domain_config_dispose(&expectconfig);
xtl_logger_destroy(log); xtl_logger_destroy(log);
cfg->caps = NULL; if (cfg)
cfg->caps = NULL;
virObjectUnref(cfg); virObjectUnref(cfg);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册