aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Rogério Brito <rbrito@ime.usp.br>2011-03-08 15:01:28 -0300
committerGravatar Rogério Brito <rbrito@ime.usp.br>2011-03-08 15:01:34 -0300
commit891b53ce003db7be264bba8b6cd3d547c050099f (patch)
treee2c9697cc607166d9c93cf385690a997faca9c19
parent26cc42d5a92968ed3bbf7b58aa1ea93ec1384fd0 (diff)
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.
-rw-r--r--src/cddb.c5
1 files changed, 5 insertions, 0 deletions
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;
}