changeset 675:632e797d9509 trunk

[svn] - Fix a crash relating to changing FLAC plugin settings. Closes bug #412.
author nenolod
date Fri, 24 Feb 2006 22:47:30 -0800
parents 9e553cf3d756
children 2561275dc71b
files Plugins/Input/flac/configure.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/flac/configure.c	Fri Feb 24 22:05:06 2006 -0800
+++ b/Plugins/Input/flac/configure.c	Fri Feb 24 22:47:30 2006 -0800
@@ -154,28 +154,35 @@
 	flac_cfg.stream.http_prebuffer = (gint) GTK_ADJUSTMENT(streaming_pre_adj)->value;
 
 	flac_cfg.stream.use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
-	g_free(flac_cfg.stream.proxy_host);
+
+	if (flac_cfg.stream.proxy_host != NULL)
+		g_free(flac_cfg.stream.proxy_host);
+
 	flac_cfg.stream.proxy_host = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_host_entry)));
 	flac_cfg.stream.proxy_port = atoi(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_port_entry)));
 
 	flac_cfg.stream.proxy_use_auth = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use));
 
-	if(flac_cfg.stream.proxy_user)
+	if(flac_cfg.stream.proxy_user != NULL)
 		g_free(flac_cfg.stream.proxy_user);
+
 	flac_cfg.stream.proxy_user = NULL;
 	if(strlen(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry))) > 0)
 		flac_cfg.stream.proxy_user = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry)));
 
-	if(flac_cfg.stream.proxy_pass)
+	if(flac_cfg.stream.proxy_pass != NULL)
 		g_free(flac_cfg.stream.proxy_pass);
+
 	flac_cfg.stream.proxy_pass = NULL;
 	if(strlen(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry))) > 0)
 		flac_cfg.stream.proxy_pass = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry)));
 
 
 	flac_cfg.stream.save_http_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use));
-	if (flac_cfg.stream.save_http_path)
+
+	if (flac_cfg.stream.save_http_path != NULL)
 		g_free(flac_cfg.stream.save_http_path);
+
 	flac_cfg.stream.save_http_path = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_save_entry)));
 
 #ifdef FLAC_ICECAST