# HG changeset patch
# User Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
# Date 1314112289 10800
# Node ID 277b56b3863b5f81a3faa18aeb7b9951b963b489
# Parent a346baf140d64177a9dc1066677c307ee6518236
VirtualSystemManagementService: Fix yet another possible leak
Signed-off-by: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
diff --git a/src/Virt_VirtualSystemManagementService.c
b/src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c
+++ b/src/Virt_VirtualSystemManagementService.c
@@ -1377,7 +1377,11 @@
if (tmp == NULL)
return false;
- memcpy(tmp, *list, sizeof(*tmp) * cur);
+ if (*list) {
+ memcpy(tmp, *list, sizeof(*tmp) * cur);
+ free(*list);
+ }
+
*list = tmp;
return true;