mirror of https://gitee.com/openkylin/libvirt.git
libxl: Fix double-dispose of libxl domain config
libxlBuildDomainConfig() was disposing the libxl_domain_config object on error, only to have it disposed again by libxlBuildDomainConfig()'s caller, which resulted in a segfault. Leave disposing of the config object to it's owner.
This commit is contained in:
parent
e0eb672e00
commit
80f01915b5
|
@ -796,19 +796,19 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (libxlMakeDomBuildInfo(def, d_config) < 0) {
|
if (libxlMakeDomBuildInfo(def, d_config) < 0) {
|
||||||
goto error;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libxlMakeDiskList(def, d_config) < 0) {
|
if (libxlMakeDiskList(def, d_config) < 0) {
|
||||||
goto error;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libxlMakeNicList(def, d_config) < 0) {
|
if (libxlMakeNicList(def, d_config) < 0) {
|
||||||
goto error;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libxlMakeVfbList(driver, def, d_config) < 0) {
|
if (libxlMakeVfbList(driver, def, d_config) < 0) {
|
||||||
goto error;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
d_config->on_reboot = def->onReboot;
|
d_config->on_reboot = def->onReboot;
|
||||||
|
@ -816,8 +816,4 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
|
||||||
d_config->on_crash = def->onCrash;
|
d_config->on_crash = def->onCrash;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
|
||||||
libxl_domain_config_dispose(d_config);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue