]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: Fix double-dispose of libxl domain config
authorJim Fehlig <jfehlig@suse.com>
Mon, 29 Apr 2013 23:04:55 +0000 (17:04 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 30 Apr 2013 15:13:42 +0000 (09:13 -0600)
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.

src/libxl/libxl_conf.c

index 7e0753a69ed4a0867d14843cbad20d1430a67f0c..3de642b91d056d93d4fa59754620f1c76d6fb445 100644 (file)
@@ -796,19 +796,19 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
         return -1;
 
     if (libxlMakeDomBuildInfo(def, d_config) < 0) {
-        goto error;
+        return -1;
     }
 
     if (libxlMakeDiskList(def, d_config) < 0) {
-        goto error;
+        return -1;
     }
 
     if (libxlMakeNicList(def, d_config) < 0) {
-        goto error;
+        return -1;
     }
 
     if (libxlMakeVfbList(driver, def, d_config) < 0) {
-        goto error;
+        return -1;
     }
 
     d_config->on_reboot = def->onReboot;
@@ -816,8 +816,4 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
     d_config->on_crash = def->onCrash;
 
     return 0;
-
-error:
-    libxl_domain_config_dispose(d_config);
-    return -1;
 }