render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c1c534
From a4c7051325a78ece1923633d734903f1596a80d6 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <a4c7051325a78ece1923633d734903f1596a80d6@dist-git>
c1c534
From: Martin Kletzander <mkletzan@redhat.com>
c1c534
Date: Wed, 31 Jan 2018 16:32:37 +0100
c1c534
Subject: [PATCH] util: Make it possible for virResctrlAllocSetMask to replace
c1c534
 existing mask
c1c534
c1c534
This wil be used in the future, but it makes sense for now as well.  It makes
c1c534
sure there is no mask leftover that would leak.
c1c534
c1c534
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
c1c534
(cherry picked from commit 6899118043ec4e6bd35f1641fe71dc67bfce3859)
c1c534
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1289368
c1c534
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
c1c534
---
c1c534
 src/util/virresctrl.c | 1 +
c1c534
 1 file changed, 1 insertion(+)
c1c534
c1c534
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
c1c534
index a1d09c547e..89b1382b68 100644
c1c534
--- a/src/util/virresctrl.c
c1c534
+++ b/src/util/virresctrl.c
c1c534
@@ -1239,6 +1239,7 @@ virResctrlAllocSetMask(virResctrlAllocPerTypePtr a_type,
c1c534
                      cache - a_type->nmasks + 1) < 0)
c1c534
         return -1;
c1c534
 
c1c534
+    virBitmapFree(a_type->masks[cache]);
c1c534
     a_type->masks[cache] = mask;
c1c534
 
c1c534
     return 0;
c1c534
-- 
c1c534
2.16.1
c1c534