[gnome-commander/get_rid_of_xml] Free also the last element of the array of char pointers



commit 90857dc7494421056bb458daadacb2f6308afce6
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Tue Nov 20 08:58:02 2018 +0100

    Free also the last element of the array of char pointers

 src/gnome-cmd-data.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index d88ce79d..78b26847 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -2528,7 +2528,7 @@ gboolean GnomeCmdData::set_gsettings_string_array_from_glist (GSettings *setting
     }
     else
     {
-        gint ii;
+        guint ii;
         gchar** str_array;
         str_array = (gchar**) g_malloc ((g_list_length (strings) + 1) * sizeof(char*));
 
@@ -2542,7 +2542,7 @@ gboolean GnomeCmdData::set_gsettings_string_array_from_glist (GSettings *setting
         rv = g_settings_set_strv(settings_given, key, str_array);
 
         // Free the char array
-        for (ii = 0; strings; strings = strings->next, ++ii)
+        for (ii = 0; ii < (g_list_length (strings) + 1); ii++)
         {
             g_free(str_array[ii]);
         }


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