]> xenbits.xensource.com Git - libvirt.git/commitdiff
LXC: avoid useless duplicate memory free
authorGao feng <gaofeng@cn.fujitsu.com>
Tue, 19 Jun 2012 01:33:20 +0000 (09:33 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 19 Jun 2012 08:09:47 +0000 (16:09 +0800)
when lxcContainerIdentifyCGroups failed, the memory it allocated
has been freed, so we should not free this memory again in
lxcContainerSetupPivortRoot and lxcContainerSetupExtraMounts.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
src/lxc/lxc_container.c

index 9045a7d50eda10c305cac5862b3d6c44733cfc43..24b101735e1739a1ca3ac4415fea128968f587d2 100644 (file)
@@ -1323,7 +1323,7 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
     /* Before pivoting we need to identify any
      * cgroups controllers that are mounted */
     if (lxcContainerIdentifyCGroups(&mounts, &nmounts) < 0)
-        goto cleanup;
+        return -1;
 
     /* Gives us a private root, leaving all parent OS mounts on /.oldroot */
     if (lxcContainerPivotRoot(root) < 0)
@@ -1406,7 +1406,7 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
     /* Before replacing /sys we need to identify any
      * cgroups controllers that are mounted */
     if (lxcContainerIdentifyCGroups(&mounts, &nmounts) < 0)
-        goto cleanup;
+        return -1;
 
     /* Gets rid of any existing stuff under /proc, since we need new
      * namespace aware versions of those. We must do /proc second