[gnome-commander/get_rid_of_xml] Free allocated memory in save_advrename_profiles



commit 9ee03e7d63b1328bb92b5ad21791de370af639a6
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Wed Nov 21 22:52:12 2018 +0100

    Free allocated memory in save_advrename_profiles

 src/gnome-cmd-data.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index cae3a9ea..3ede34bf 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1603,10 +1603,12 @@ void GnomeCmdData::save_advrename_profiles (const gchar *fname)
     // The following is copied into the for-loop below.
     // ToDo: Fix this ugly code copy!
 
+    gchar* templateString = g_strescape (advrename_defaults.templates.empty()  ? "$N" : 
advrename_defaults.templates.front(), NULL);
     g_key_file_set_string(key_file,
                           ADVRENAME_DEFAULT_TEMPLATE,
                           ADVRENAME_TEMPLATE,
-                          g_strescape (advrename_defaults.templates.empty()  ? "$N" : 
advrename_defaults.templates.front(), NULL));
+                          templateString);
+    g_free(templateString);
 
     g_key_file_set_uint64(key_file,
                           ADVRENAME_DEFAULT_TEMPLATE,


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