[PATCH 30/39] util: virresctrl: Use automatic memory freeing

Ján Tomko jtomko at redhat.com
Fri Apr 9 14:23:19 UTC 2021


On a Thursday in 2021, Peter Krempa wrote:
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/util/virresctrl.c | 53 ++++++++++++++-----------------------------
> 1 file changed, 17 insertions(+), 36 deletions(-)
>
>@@ -1945,7 +1937,7 @@ virResctrlAllocFindUnused(virResctrlAllocPtr alloc,
> {
>     unsigned long long *size = alloc->levels[level]->types[type]->sizes[cache];
>     virBitmapPtr a_mask = NULL;
>-    virBitmapPtr f_mask = NULL;
>+    g_autoptr(virBitmap) f_mask = NULL;

a_mask should be the one marked with g_auto

>     unsigned long long need_bits;
>     size_t i = 0;
>     ssize_t pos = -1;
>@@ -2049,7 +2041,6 @@ virResctrlAllocFindUnused(virResctrlAllocPtr alloc,
>
>     ret = 0;
>  cleanup:
>-    virBitmapFree(a_mask);
>     return ret;
> }
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210409/6648e5bd/attachment-0001.sig>


More information about the libvir-list mailing list