In the current code if mem_mask is NULL there is a "goto error", but
we freeing it without knowing if mem_mask is NULL or not, therefor
I've had a check.

Signed-off-by: Matthias Gatto <[email protected]>
---
 src/qemu/qemu_cgroup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index ca255c8..926726c 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -810,7 +810,8 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
         goto error;
 
  cleanup:
-    VIR_FREE(mem_mask);
+    if (mem_mask)
+        VIR_FREE(mem_mask);
     virBitmapFree(all_nodes);
     return;
 
-- 
1.8.3.1

--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to