mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-19 08:57:14 -05:00
array: re-initialize the array in pw_array_clear()
Leaving the data nonzero is a use-after-free bug waiting to happen.
This commit is contained in:
parent
7123fadc37
commit
e36183d3cf
2 changed files with 30 additions and 0 deletions
|
|
@ -98,6 +98,7 @@ static inline void pw_array_init(struct pw_array *arr, size_t extend)
|
|||
static inline void pw_array_clear(struct pw_array *arr)
|
||||
{
|
||||
free(arr->data);
|
||||
pw_array_init(arr, arr->extend);
|
||||
}
|
||||
|
||||
/** Reset the array */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue