src/openvz_driver.c: Fix segfault in OpenVZ driver

(Evgeniy Sokolov).
This commit is contained in:
Richard W.M. Jones 2008-09-17 16:07:03 +00:00
parent bf347f5af0
commit a0208e6635
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,8 @@
Wed Sep 17 17:02:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
* src/openvz_driver.c: Fix segfault in OpenVZ driver
(Evgeniy Sokolov).
Wed Sep 17 16:38:00 BST 2008 Daniel P berrange <berrange@redhat.com> Wed Sep 17 16:38:00 BST 2008 Daniel P berrange <berrange@redhat.com>
* tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml, * tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml,

View File

@ -436,9 +436,10 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
vm = virDomainFindByName(driver->domains, vmdef->name); vm = virDomainFindByName(driver->domains, vmdef->name);
if (vm) { if (vm) {
virDomainDefFree(vmdef); openvzError(conn, VIR_ERR_OPERATION_FAILED,
openvzLog(OPENVZ_ERR, _("Already an OPENVZ VM active with the id '%s'"), _("Already an OPENVZ VM active with the id '%s'"),
vmdef->name); vmdef->name);
virDomainDefFree(vmdef);
return NULL; return NULL;
} }
if (!(vm = virDomainAssignDef(conn, &driver->domains, vmdef))) { if (!(vm = virDomainAssignDef(conn, &driver->domains, vmdef))) {
@ -512,10 +513,10 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
vm = virDomainFindByName(driver->domains, vmdef->name); vm = virDomainFindByName(driver->domains, vmdef->name);
if (vm) { if (vm) {
openvzError(conn, VIR_ERR_OPERATION_FAILED,
_("Already an OPENVZ VM defined with the id '%s'"),
vmdef->name);
virDomainDefFree(vmdef); virDomainDefFree(vmdef);
openvzLog(OPENVZ_ERR,
_("Already an OPENVZ VM defined with the id '%d'"),
strtoI(vmdef->name));
return NULL; return NULL;
} }
if (!(vm = virDomainAssignDef(conn, &driver->domains, vmdef))) { if (!(vm = virDomainAssignDef(conn, &driver->domains, vmdef))) {