[easytag] Fix two memory leaks in Add_String_To_Combo_List



commit cca8579f23f9e8af5d50c790ee64ca5ede7242e8
Author: David King <amigadave amigadave com>
Date:   Mon Feb 11 19:02:36 2013 +0000

    Fix two memory leaks in Add_String_To_Combo_List

 src/misc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/misc.c b/src/misc.c
index 4e1a4e9..b0a1799 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -277,7 +277,10 @@ gboolean Add_String_To_Combo_List (GtkListStore *liststore, const gchar *str)
     gchar *string = g_strdup(str);
 
     if (!string || g_utf8_strlen(string, -1) <= 0)
+    {
+        g_free (string);
         return FALSE;
+    }
 
 #if 0
     // We add the string to the beginning of the list store
@@ -335,6 +338,7 @@ gboolean Add_String_To_Combo_List (GtkListStore *liststore, const gchar *str)
             gtk_tree_model_get(GTK_TREE_MODEL(liststore), &iter, MISC_COMBO_TEXT, &text, -1);
             if (g_utf8_collate(text, string) == 0)
             {
+                g_free (string);
                 g_free(text);
                 return FALSE;
             }


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