]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix lxc syntax-check failure
authorMark McLoughlin <markmc@redhat.com>
Thu, 16 Apr 2009 13:08:03 +0000 (13:08 +0000)
committerMark McLoughlin <markmc@redhat.com>
Thu, 16 Apr 2009 13:08:03 +0000 (13:08 +0000)
Fixes:

 CHECK: avoid_if_before_free
 src/lxc_container.c: if (oldroot) VIR_FREE(oldroot)
 src/lxc_container.c: if (newroot) VIR_FREE(newroot)
 Makefile.maint: found useless "if" before "free" above

and:

 src/lxc_container.c:317:
 Makefile.maint: found trailing blank(s)

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
ChangeLog
src/lxc_container.c

index 5b6b343db40af18fe347c68f3cdafde830fd57bd..05119a752c9dd9258d08d87d26441fe905f8c592 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Apr 16 14:05:28 GMT 2009 Mark McLoughlin <markmc@redhat.com>
+
+       * src/lxc_container.c: syntax-check fixes
+
 Wed Apr 15 22:40:50 CEST 2009 Daniel Veillard <veillard@redhat.com>
 
        * docs/Makefile.am docs/api.html docs/api.html.in docs/archdomain.html
index ff115d1889a33dcee53b3488a28fd1e4b279a2d2..67c66bd9b37b8bbd646672f48266aeb8666e8ff3 100644 (file)
@@ -282,9 +282,11 @@ static int lxcContainerChildMountSort(const void *a, const void *b)
 
 static int lxcContainerPivotRoot(virDomainFSDefPtr root)
 {
-    int rc;
+    int rc, ret;
     char *oldroot = NULL, *newroot = NULL;
 
+    ret = -1;
+
     /* root->parent must be private, so make / private. */
     if (mount("", "/", NULL, MS_PRIVATE|MS_REC, NULL) < 0) {
         virReportSystemError(NULL, errno, "%s",
@@ -312,7 +314,7 @@ static int lxcContainerPivotRoot(virDomainFSDefPtr root)
                              oldroot);
         goto err;
     }
-       
+
     /* Create a directory called 'new' in tmpfs */
     if (virAsprintf(&newroot, "%s/new", oldroot) < 0) {
         virReportOOMError(NULL);
@@ -366,15 +368,13 @@ static int lxcContainerPivotRoot(virDomainFSDefPtr root)
         goto err;
     }
 
+    ret = 0;
+
+err:
     VIR_FREE(oldroot);
     VIR_FREE(newroot);
 
-    return 0;
-
-err:
-    if (oldroot) VIR_FREE(oldroot);
-    if (newroot) VIR_FREE(newroot);
-    return -1;
+    return ret;
 }
 
 static int lxcContainerPopulateDevices(void)