]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vircgrouptest: Don't leak @cgroup
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Aug 2017 07:13:36 +0000 (09:13 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Aug 2017 09:22:27 +0000 (11:22 +0200)
In these test cases we create internal representation of cgroup,
however, never free it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/vircgrouptest.c

index b932b1ad535c43d5e57c54737b2cec1d8447c835..1e551cfc7b37c6484f6a386be61125e0c9b77c45 100644 (file)
@@ -353,6 +353,7 @@ static int testCgroupNewForPartitionNested(const void *args ATTRIBUTE_UNUSED)
     }
 
     /* Should now work */
+    virCgroupFree(&cgroup);
     if ((rv = virCgroupNewPartition("/deployment/production", true, -1, &cgroup)) != 0) {
         fprintf(stderr, "Failed to create /deployment/production cgroup: %d\n", -rv);
         goto cleanup;
@@ -401,12 +402,14 @@ static int testCgroupNewForPartitionNestedDeep(const void *args ATTRIBUTE_UNUSED
         goto cleanup;
     }
 
+    virCgroupFree(&cgroup);
     if ((rv = virCgroupNewPartition("/user/berrange.user", true, -1, &cgroup)) != 0) {
         fprintf(stderr, "Failed to create /user/berrange.user cgroup: %d\n", -rv);
         goto cleanup;
     }
 
     /* Should now work */
+    virCgroupFree(&cgroup);
     if ((rv = virCgroupNewPartition("/user/berrange.user/production", true, -1, &cgroup)) != 0) {
         fprintf(stderr, "Failed to create /user/berrange.user/production cgroup: %d\n", -rv);
         goto cleanup;