mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-02 01:40:08 -05:00
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:
parent
368ea9af82
commit
8df60992b7
1 changed files with 7 additions and 2 deletions
|
|
@ -68,6 +68,11 @@ int bag_del(bag_t *bag, void *ptr)
|
||||||
|
|
||||||
void bag_del_all(bag_t *bag)
|
void bag_del_all(bag_t *bag)
|
||||||
{
|
{
|
||||||
while (!list_empty(bag))
|
struct list_head *pos, *npos;
|
||||||
list_del(bag->next);
|
|
||||||
|
list_for_each_safe(pos, npos, bag) {
|
||||||
|
bag1_t *b = list_entry(pos, bag1_t, list);
|
||||||
|
list_del(&b->list);
|
||||||
|
free(b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue