[PATCH 02/14] libxlMakeDomBuildInfo: Don't use VIR_DISPOSE_N for USB device list

Peter Krempa pkrempa at redhat.com
Mon Feb 1 13:38:54 UTC 2021


The list isn't secret which would need being disposed of. Just expand
the array and return failure when adding the NULL terminator similarly
to how we expand the list for adding devices in a loop.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/libxl/libxl_conf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 6a8ae27f54..cb1fd7df7d 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -686,7 +686,6 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
         /* NULL-terminate usbdevice_list */
         if (nusbdevice > 0 &&
             VIR_EXPAND_N(b_info->u.hvm.usbdevice_list, nusbdevice, 1) < 0) {
-            VIR_DISPOSE_N(b_info->u.hvm.usbdevice_list, nusbdevice);
             return -1;
         }
 #endif
-- 
2.29.2




More information about the libvir-list mailing list