mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
vbox: fix segfault on virsh dumpxml with the existence of USB filters
A USB filter is stored in a hostdev. The original code doesn't allocate hostdev->info that is expected to be allocated with hostdev. So use virDomainHostdevDefAlloc() to allocate both as we expect. Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
This commit is contained in:
parent
4a601c3080
commit
8229e33adc
@ -3333,7 +3333,8 @@ sharedFoldersCleanup:
|
||||
|
||||
deviceFilter->vtbl->GetActive(deviceFilter, &active);
|
||||
if (active) {
|
||||
if (VIR_ALLOC(def->hostdevs[USBFilterCount]) >= 0) {
|
||||
def->hostdevs[USBFilterCount] = virDomainHostdevDefAlloc();
|
||||
if (def->hostdevs[USBFilterCount]) {
|
||||
PRUnichar *vendorIdUtf16 = NULL;
|
||||
char *vendorIdUtf8 = NULL;
|
||||
unsigned vendorId = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user