# HG changeset patch # User Tomasz Mon # Date 1242109843 -7200 # Node ID 062f42c3737e08d1a1ad0a3cec5e5ca441d34de5 # Parent 4b50e2a0ae1f391bad69c4e5166dfcd01854ea13 Fix possible crash in scrobbler plugin diff -r 4b50e2a0ae1f -r 062f42c3737e src/scrobbler/configure.c --- a/src/scrobbler/configure.c Mon May 11 12:25:48 2009 -0500 +++ b/src/scrobbler/configure.c Tue May 12 08:30:43 2009 +0200 @@ -19,8 +19,6 @@ #include "configure.h" #include "plugin.h" -#define LASTFM_HS_URL "http://post.audioscrobbler.com" - GtkWidget *entry1, *entry2, *entry3, *ge_entry1, *ge_entry2, *cfgdlg; static GdkColor disabled_color; guint apply_timeout = 0; /* ID of timeout to save new config */ diff -r 4b50e2a0ae1f -r 062f42c3737e src/scrobbler/scrobbler.c --- a/src/scrobbler/scrobbler.c Mon May 11 12:25:48 2009 -0500 +++ b/src/scrobbler/scrobbler.c Tue May 12 08:30:43 2009 +0200 @@ -1083,7 +1083,10 @@ sc_challenge_hash = sc_major_error = NULL; sc_username = strdup(uname); sc_password = strdup(pwd); - sc_hs_url = strdup(url); + if (url) + sc_hs_url = strdup(url); + else + sc_hs_url = strdup(LASTFM_HS_URL); read_cache(); pdebug("scrobbler starting up", DEBUG); } diff -r 4b50e2a0ae1f -r 062f42c3737e src/scrobbler/settings.h --- a/src/scrobbler/settings.h Mon May 11 12:25:48 2009 -0500 +++ b/src/scrobbler/settings.h Tue May 12 08:30:43 2009 +0200 @@ -8,5 +8,6 @@ #define SUB_DEBUG 0 #define CLIENT "Audacious" #define USER_AGENT "AudioScrobbler/1.1" PACKAGE_NAME "/" PACKAGE_VERSION +#define LASTFM_HS_URL "http://post.audioscrobbler.com" #endif