[easytag] Fix a memory leak when freeing the history list
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Fix a memory leak when freeing the history list
- Date: Sun, 22 Feb 2015 12:46:14 +0000 (UTC)
commit aba60f35e96ecfbc5a5b4c9ccb834aeed670bfdc
Author: David King <amigadave amigadave com>
Date: Sun Feb 22 12:43:19 2015 +0000
Fix a memory leak when freeing the history list
src/file_list.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/file_list.c b/src/file_list.c
index f574cde..9f4f6ac 100644
--- a/src/file_list.c
+++ b/src/file_list.c
@@ -90,7 +90,10 @@ et_history_file_list_free (GList *file_list)
{
g_return_if_fail (file_list != NULL);
- g_list_free_full (file_list, (GDestroyNotify)et_history_file_free);
+ /* et_history_list_add() sets the list to the final element, so explicitly
+ * go back to the start. */
+ g_list_free_full (g_list_first (file_list),
+ (GDestroyNotify)et_history_file_free);
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]