From: Martin Kletzander Date: Fri, 26 Jan 2018 13:47:19 +0000 (+0100) Subject: util: Make it possible for virResctrlAllocSetMask to replace existing mask X-Git-Tag: v4.1.0-rc1~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6899118043ec4e6bd35f1641fe71dc67bfce3859;p=thirdparty%2Flibvirt.git util: Make it possible for virResctrlAllocSetMask to replace existing mask This wil be used in the future, but it makes sense for now as well. It makes sure there is no mask leftover that would leak. Signed-off-by: Martin Kletzander --- diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index a1d09c547e..89b1382b68 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -1239,6 +1239,7 @@ virResctrlAllocSetMask(virResctrlAllocPerTypePtr a_type, cache - a_type->nmasks + 1) < 0) return -1; + virBitmapFree(a_type->masks[cache]); a_type->masks[cache] = mask; return 0;