mixer: bag - fix bag_del_all implementation (missing free)

The bag1_t structure must be freed, too.

Fixes: https://github.com/alsa-project/alsa-lib/issues/453
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-05-09 09:55:00 +02:00
parent 368ea9af82
commit 8df60992b7

View file

@ -68,6 +68,11 @@ int bag_del(bag_t *bag, void *ptr)
void bag_del_all(bag_t *bag)
{
while (!list_empty(bag))
list_del(bag->next);
struct list_head *pos, *npos;
list_for_each_safe(pos, npos, bag) {
bag1_t *b = list_entry(pos, bag1_t, list);
list_del(&b->list);
free(b);
}
}