libxl_driver: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-12-07 16:17:38 +01:00
parent 6181d8a61b
commit e4b00827ed

View File

@ -2416,7 +2416,7 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
libxlDriverPrivate *driver = dom->conn->privateData; libxlDriverPrivate *driver = dom->conn->privateData;
libxlDriverConfig *cfg = libxlDriverConfigGet(driver); libxlDriverConfig *cfg = libxlDriverConfigGet(driver);
virDomainDef *targetDef = NULL; virDomainDef *targetDef = NULL;
virBitmap *pcpumap = NULL; g_autoptr(virBitmap) pcpumap = NULL;
virDomainVcpuDef *vcpuinfo; virDomainVcpuDef *vcpuinfo;
virDomainObj *vm; virDomainObj *vm;
int ret = -1; int ret = -1;
@ -2477,7 +2477,6 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
cleanup: cleanup:
virDomainObjEndAPI(&vm); virDomainObjEndAPI(&vm);
virBitmapFree(pcpumap);
virObjectUnref(cfg); virObjectUnref(cfg);
return ret; return ret;
} }
@ -4808,7 +4807,7 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
libxlDriverConfig *cfg = libxlDriverConfigGet(driver); libxlDriverConfig *cfg = libxlDriverConfigGet(driver);
virDomainObj *vm; virDomainObj *vm;
libxl_bitmap nodemap; libxl_bitmap nodemap;
virBitmap *nodes = NULL; g_autoptr(virBitmap) nodes = NULL;
int rc, ret = -1; int rc, ret = -1;
size_t i, j; size_t i, j;
@ -4907,7 +4906,6 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
ret = 0; ret = 0;
cleanup: cleanup:
virBitmapFree(nodes);
libxl_bitmap_dispose(&nodemap); libxl_bitmap_dispose(&nodemap);
virDomainObjEndAPI(&vm); virDomainObjEndAPI(&vm);
virObjectUnref(cfg); virObjectUnref(cfg);