commit d9a847e3118a30e73b796cea2685a0676d9fb6fc
Author: Andrea Odetti <[email protected]>
Date:   Sun Nov 1 14:21:46 2009 +0000

    Bug fix, memory leak and double free.

 src/repository.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/repository.c b/src/repository.c
index f05caec..0556a15 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -331,7 +331,6 @@ static gboolean finish_editable_storage (RepWin *repwin,
    prefs system. If values differ, store @val for @key in
    @repwin->temp_prefs, otherwise remove a possibly existing entry
    @key in @repwin->temp_prefs. */
-/* Attention: g_frees() @key for you */
 static void finish_int_storage (RepWin *repwin,
                                gchar *key, gint val)
 {
@@ -358,7 +357,6 @@ static void finish_int_storage (RepWin *repwin,
        temp_prefs_remove_key (repwin->temp_prefs, key);
     }
     update_buttons (repwin);
-    g_free (key);
 }
 
 
@@ -420,6 +418,8 @@ static void sync_playlist_mode_none_toggled 
(GtkToggleButton *togglebutton,
                            SYNC_PLAYLIST_MODE_NONE);
        update_buttons (repwin);
     }
+
+    g_free (key);
 }
 
 
@@ -440,6 +440,8 @@ static void sync_playlist_mode_manual_toggled 
(GtkToggleButton *togglebutton,
                            SYNC_PLAYLIST_MODE_MANUAL);
        update_buttons (repwin);
     }
+
+    g_free (key);
 }
 
 
@@ -478,6 +480,8 @@ static void standard_itdb_checkbutton_toggled 
(GtkToggleButton *togglebutton,
     key = get_itdb_prefs_key (repwin->itdb_index, keybase);
     finish_int_storage (repwin, key,
                        gtk_toggle_button_get_active (togglebutton));
+
+    g_free (key);
 }
 
 
@@ -507,10 +511,12 @@ static void standard_playlist_checkbutton_toggled 
(GtkToggleButton *togglebutton
            temp_prefs_set_int (repwin->extra_prefs, key, active);
 
        update_buttons (repwin);
+       g_free (key);
        return;
     }
        
     finish_int_storage (repwin, key, active);
+    g_free (key);
 }
 
 /* delete_repository_button was clicked */

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to