]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxlMakeDomBuildInfo: Don't use VIR_DISPOSE_N for USB device list
authorPeter Krempa <pkrempa@redhat.com>
Mon, 1 Feb 2021 11:12:42 +0000 (12:12 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 3 Feb 2021 12:07:12 +0000 (13:07 +0100)
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@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/libxl/libxl_conf.c

index 6a8ae27f544a718c14752b2803dfb94d070dfba2..cb1fd7df7d7f66a06e19442a715bf02654c582c0 100644 (file)
@@ -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