mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
vbox: Don't leak arrays from XPCOM
XPCOM returns an array as a pointer to an array of pointers to the actual items. When the array isn't needed anymore the items are released, but the actual array containing the pointers to the items was not freed and leaked. Free the actual array using ComUnallocMem. This doesn't affect MSCOM as SafeArrayDestroy releases all items and frees the array.
This commit is contained in:
parent
d5b1933e56
commit
8c572b6c78
@ -339,6 +339,8 @@ vboxArrayRelease(vboxArray *array)
|
||||
}
|
||||
}
|
||||
|
||||
pVBoxFuncs_v2_2->pfnComUnallocMem(array->items);
|
||||
|
||||
array->items = NULL;
|
||||
array->count = 0;
|
||||
}
|
||||
@ -365,6 +367,8 @@ vboxArrayUnalloc(vboxArray *array)
|
||||
}
|
||||
}
|
||||
|
||||
pVBoxFuncs_v2_2->pfnComUnallocMem(array->items);
|
||||
|
||||
array->items = NULL;
|
||||
array->count = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user