Mercurial > audlegacy
changeset 4179:aca0dd668f7b
Jump to Track leaks memory when matching songs. (Bugzilla #81)
author | Jussi Judin <jjudin+audacious@iki.fi> |
---|---|
date | Fri, 11 Jan 2008 15:37:24 +0100 |
parents | cb0952a41f7b |
children | bd45235ed618 |
files | src/audacious/ui_jumptotrack.c |
diffstat | 1 files changed, 5 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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 );