watchlist: Fix memory leak
This commit is contained in:
parent
8ce787557f
commit
5b6c18fadd
|
@ -128,12 +128,14 @@ static void __watchlist_clear(struct watchlist *watchlist)
|
||||||
void watchlist_destroy(struct watchlist *watchlist)
|
void watchlist_destroy(struct watchlist *watchlist)
|
||||||
{
|
{
|
||||||
__watchlist_clear(watchlist);
|
__watchlist_clear(watchlist);
|
||||||
|
l_queue_destroy(watchlist->items, NULL);
|
||||||
watchlist->items = NULL;
|
watchlist->items = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void watchlist_free(struct watchlist *watchlist)
|
void watchlist_free(struct watchlist *watchlist)
|
||||||
{
|
{
|
||||||
__watchlist_clear(watchlist);
|
__watchlist_clear(watchlist);
|
||||||
|
l_queue_destroy(watchlist->items, NULL);
|
||||||
l_free(watchlist);
|
l_free(watchlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue