changeset 21022:3f8b32a4786c

Fix this warning: user.c: In function 'msim_store_user_info_each': user.c:214: warning: ISO C90 forbids mixed declarations and code
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 26 Oct 2007 13:22:49 +0000
parents f710e48fbe1b
children 42ecde230f91 61a87e02da29
files libpurple/protocols/myspace/user.c
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/user.c	Fri Oct 26 05:24:14 2007 +0000
+++ b/libpurple/protocols/myspace/user.c	Fri Oct 26 13:22:49 2007 +0000
@@ -203,14 +203,6 @@
 		/* Ignore because PurpleBuddy knows this already */
 		g_free(value_str);
 	} else if (g_str_equal(key_str, "ImageURL") || g_str_equal(key_str, "AvatarURL")) {
-		if (user->temporary_user) {
-			/* This user will be destroyed soon; don't try to look up its image or avatar, 
-			 * since that won't return immediately and we will end up accessing freed data.
-			 */
-			g_free(value_str);
-			return;
-		}
-		
 		const gchar *previous_url;
 
 		if (user->temporary_user) {
@@ -220,7 +212,15 @@
 			g_free(value_str);
 			return;
 		}
-		
+
+		if (user->temporary_user) {
+			/* This user will be destroyed soon; don't try to look up its image or avatar, 
+			 * since that won't return immediately and we will end up accessing freed data.
+			 */
+			g_free(value_str);
+			return;
+		}
+
 		g_free(user->image_url);
 
 		user->image_url = value_str;
@@ -233,7 +233,7 @@
 				NULL, 0, NULL);
 			return;
 		}
-	
+
 		/* TODO: use ETag for checksum */
 		previous_url = purple_buddy_icons_get_checksum_for_user(user->buddy);