watchlist: Fix memory leak

This commit is contained in:
Denis Kenzior 2017-10-18 19:29:24 -05:00
parent 8ce787557f
commit 5b6c18fadd
1 changed files with 2 additions and 0 deletions

View File

@ -128,12 +128,14 @@ static void __watchlist_clear(struct watchlist *watchlist)
void watchlist_destroy(struct watchlist *watchlist)
{
__watchlist_clear(watchlist);
l_queue_destroy(watchlist->items, NULL);
watchlist->items = NULL;
}
void watchlist_free(struct watchlist *watchlist)
{
__watchlist_clear(watchlist);
l_queue_destroy(watchlist->items, NULL);
l_free(watchlist);
}