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>
/* 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