# HG changeset patch # User ib # Date 1328995070 0 # Node ID a5d0652dd1a0f79fabc47e130b789cf667421540 # Parent f9b7f4b48fcbda8f4343f41dae4f3c51137a7dcf Fix bug in freeing playlist items. If there were several items, the last item wasn't freed. Simplify code. diff -r f9b7f4b48fcb -r a5d0652dd1a0 gui/util/list.c --- a/gui/util/list.c Sat Feb 11 21:05:34 2012 +0000 +++ b/gui/util/list.c Sat Feb 11 21:17:50 2012 +0000 @@ -139,30 +139,16 @@ // delete list case gtkDelPl: - { - plItem *curr = plList; - plItem *next; - - if (!plList) - return NULL; + while (plList) { + plItem *next = plList->next; - if (!curr->next) { - free(curr->path); - free(curr->name); - free(curr); - } else { - while (curr->next) { - next = curr->next; - free(curr->path); - free(curr->name); - free(curr); - curr = next; - } + free(plList->path); + free(plList->name); + free(plList); + + plList = next; } - - plList = NULL; plCurrent = NULL; - } return NULL; // handle url