]> xenbits.xensource.com Git - libvirt.git/commitdiff
vircgroup: Resolve Coverity RESOURCE_LEAK
authorWang Rui <moon.wangrui@huawei.com>
Mon, 1 Sep 2014 12:08:07 +0000 (20:08 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 3 Sep 2014 19:00:19 +0000 (15:00 -0400)
Need to free 'root' and 'opts' before 'return -1' if symlink fails.

Signed-off-by: Wang Rui <moon.wangrui@huawei.com>
src/util/vircgroup.c

index 8b554a98d2b121c959abee14c133034fd9eff330..a64f08108e04ad04b39cb2bd5f5ecd0862dc0946 100644 (file)
@@ -3757,7 +3757,7 @@ virCgroupIsolateMount(virCgroupPtr group, const char *oldroot,
                                      _("Unable to symlink directory %s to %s"),
                                      group->controllers[i].mountPoint,
                                      group->controllers[i].linkPoint);
-                return -1;
+                goto cleanup;
             }
         }
     }