From 891b53ce003db7be264bba8b6cd3d547c050099f Mon Sep 17 00:00:00 2001 From: Rogério Brito Date: Tue, 8 Mar 2011 15:01:28 -0300 Subject: cddb: Plug some memory leaks. Some of these functions are way, way too big and should be split. One obvious low hanging fruit is to use some intelligent goto's to clean up and avoid a bunch of if's in the code, in the very same fashion that is used in the code of the kernel. And, to be honest, using some of the coding style conventions of the kernel here would not hurt at all. --- src/cddb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cddb.c b/src/cddb.c index dd61244..dc8cae6 100644 --- a/src/cddb.c +++ b/src/cddb.c @@ -2227,6 +2227,7 @@ gboolean Cddb_Search_Album_List_From_String_Freedb (void) { g_free(string); g_free(cddb_server_name); + g_free(cddb_server_cgi_path); return FALSE; } @@ -2547,6 +2548,7 @@ gboolean Cddb_Search_Album_List_From_String_Gnudb (void) { g_free(string); g_free(cddb_server_name); + g_free(cddb_server_cgi_path); gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchButton),FALSE); gtk_widget_set_sensitive(GTK_WIDGET(CddbStopSearchAutoButton),FALSE); return FALSE; @@ -3103,6 +3105,9 @@ gboolean Cddb_Search_Album_From_Selected_Files (void) if ( (socket_id=Cddb_Open_Connection(CDDB_USE_PROXY?CDDB_PROXY_NAME:cddb_server_name, CDDB_USE_PROXY?CDDB_PROXY_PORT:cddb_server_port)) <= 0 ) { + g_free(cddb_in); + g_free(cddb_server_name); + g_free(cddb_server_cgi_path); return FALSE; } -- cgit v1.2.3