Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/tui/listbox.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/tui/listbox.c b/src/tui/listbox.c
index bb30ca1..48ac573 100644
--- a/src/tui/listbox.c
+++ b/src/tui/listbox.c
@@ -217,15 +217,9 @@ void tx_destroy_list(struct scroll_list *list)
struct textlisttype *ttmp = list->textlist;
struct textlisttype *ctmp;
- if (ttmp != NULL) {
+ while (ttmp != NULL) {
ctmp = ttmp->next_entry;
-
- while (ttmp != NULL) {
- free(ttmp);
- ttmp = ctmp;
-
- if (ctmp != NULL)
- ctmp = ctmp->next_entry;
- }
+ free(ttmp);
+ ttmp = ctmp;
}
}
--
1.7.8.4