[PATCH v2 1/2] qemuSetupCpusetMems: Use VIR_AUTOFREE()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is one string that can be VIR_AUTOFREE used on.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_cgroup.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index c23f0af2aa..689e0839cd 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -830,7 +830,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm)
     virCgroupPtr cgroup_temp = NULL;
     qemuDomainObjPrivatePtr priv = vm->privateData;
     virDomainNumatuneMemMode mode;
-    char *mem_mask = NULL;
+    VIR_AUTOFREE(char *) mem_mask = NULL;
     int ret = -1;
 
     if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
@@ -843,7 +843,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm)
     if (virDomainNumatuneMaybeFormatNodeset(vm->def->numa,
                                             priv->autoNodeset,
                                             &mem_mask, -1) < 0)
-        goto cleanup;
+        return -1;
 
     if (mem_mask)
         if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0,
@@ -853,7 +853,6 @@ qemuSetupCpusetMems(virDomainObjPtr vm)
 
     ret = 0;
  cleanup:
-    VIR_FREE(mem_mask);
     virCgroupFree(&cgroup_temp);
     return ret;
 }
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux