[virt-tools-list] [vhostmd PATCH] fix deallocation
Michael Trapp
Michael.Trapp at sap.com
Thu Jun 21 13:19:26 UTC 2018
---
vhostmd/virt-util.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/vhostmd/virt-util.c b/vhostmd/virt-util.c
index 1c31305..b2b9670 100644
--- a/vhostmd/virt-util.c
+++ b/vhostmd/virt-util.c
@@ -91,15 +91,17 @@ vu_vm *vu_get_vm(int id)
error:
virDomainFree(dom);
- free(vm);
+ vu_vm_free(vm);
return NULL;
}
void vu_vm_free(vu_vm *vm)
{
if (vm) {
- free(vm->name);
- free(vm->uuid);
+ if (vm->name)
+ free(vm->name);
+ if (vm->uuuid)
+ free(vm->uuid);
free(vm);
}
}
--
2.15.2 (Apple Git-101.1)
More information about the virt-tools-list
mailing list