mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
libxlMakeDomBuildInfo: Don't use VIR_DISPOSE_N for USB device list
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>
This commit is contained in:
parent
9c9423a1e8
commit
b57b6b4eea
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user