[gnome-commander/get_rid_of_xml] Free memory when loading dir history



commit d38fc137310092c12c0af2a11ae2a9d8518d048b
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sat Dec 1 20:31:19 2018 +0100

    Free memory when loading dir history

 src/gnome-cmd-data.cc | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index f1b674d3..c5e7271a 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -2659,6 +2659,8 @@ inline void GnomeCmdData::load_directory_history()
     for (GList *i=directories; i; i=i->next)
     {
         gnome_cmd_con_get_dir_history (get_home_con())->add((const gchar *) i->data);
+        // the add method above copies the char strings
+        g_free(i->data);
     }
     g_list_free(directories);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]