render / rpms / libvirt

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