changeset 2285:72f340bb5ea3

automated branch merge
author mf0102 <0102@gmx.at>
date Wed, 09 Jan 2008 15:41:59 +0100
parents d19b53359b24 (current diff) 689bdfacb10c (diff)
children 4f84615468b7
files
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/scrobbler/scrobbler.c	Wed Jan 09 15:41:22 2008 +0100
+++ b/src/scrobbler/scrobbler.c	Wed Jan 09 15:41:59 2008 +0100
@@ -673,12 +673,18 @@
 	curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
 	/*cfa(&post, &last, "debug", "failed");*/
 
+        char *field_artist = fmt_escape(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL));
+        char *field_title = fmt_escape(aud_tuple_get_string(tuple, FIELD_TITLE, NULL));
+        char *field_album = aud_tuple_get_string(tuple, FIELD_ALBUM, NULL) ? fmt_escape(aud_tuple_get_string(tuple, FIELD_ALBUM, NULL)) : fmt_escape("");
 	entry = g_strdup_printf("s=%s&a=%s&t=%s&b=%s&l=%d&n=%d&m=", sc_session_id,
-		fmt_escape(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL)),
-		fmt_escape(aud_tuple_get_string(tuple, FIELD_TITLE, NULL)),
-		aud_tuple_get_string(tuple, FIELD_ALBUM, NULL) ? fmt_escape(aud_tuple_get_string(tuple, FIELD_ALBUM, NULL)) : "",
+		field_artist,
+		field_title,
+		field_album,
 		aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000,
 		aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
+        curl_free(field_artist);
+        curl_free(field_title);
+        curl_free(field_album);
 
 	curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *) entry);
 	memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf));
@@ -741,6 +747,7 @@
 	status = curl_easy_perform(curl);
 
 	curl_easy_cleanup(curl);
+        g_string_free(submission, TRUE);
 
 	if (status) {
 		pdebug(sc_curl_errbuf, DEBUG);