# HG changeset patch # User Jussi Judin # Date 1200062244 -3600 # Node ID aca0dd668f7b66bdd3769d288c1211e479ec97b0 # Parent cb0952a41f7be75fa68398b23e8076e17f10cd5e Jump to Track leaks memory when matching songs. (Bugzilla #81) diff -r cb0952a41f7b -r aca0dd668f7b src/audacious/ui_jumptotrack.c --- a/src/audacious/ui_jumptotrack.c Fri Jan 11 15:09:08 2008 +0100 +++ b/src/audacious/ui_jumptotrack.c Fri Jan 11 15:37:24 2008 +0100 @@ -239,8 +239,6 @@ static gboolean ui_jump_to_track_match(const gchar * song, GSList *regex_list) { - gboolean rv = TRUE; - if ( song == NULL ) return FALSE; @@ -248,13 +246,10 @@ { regex_t *regex = regex_list->data; if ( regexec( regex , song , 0 , NULL , 0 ) != 0 ) - { - rv = FALSE; - break; - } + return FALSE; } - return rv; + return TRUE; } void @@ -365,6 +360,8 @@ if ( regcomp( regex , words[i] , REG_NOSUB ) == 0 ) #endif regex_list = g_slist_append( regex_list , regex ); + else + g_free( regex ); } /* FIXME: Remove the connected signals before clearing @@ -451,6 +448,7 @@ { regex_t *regex = regex_list->data; regfree( regex ); + g_free( regex ); regex_list = g_slist_next(regex_list); } g_slist_free( regex_list_tmp );