changeset 17692:3aed9c8c6af7

Fix bug where string returned from msim_msg_get_string() is not a new string if the data type is a string (oops). This fixes the get info crash on Windows.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Thu, 05 Jul 2007 00:29:25 +0000
parents b9fd55903979
children 3c613fec5617
files libpurple/protocols/myspace/message.c libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/message.c	Wed Jul 04 22:48:52 2007 +0000
+++ b/libpurple/protocols/myspace/message.c	Thu Jul 05 00:29:25 2007 +0000
@@ -834,7 +834,7 @@
 
 		case MSIM_TYPE_STRING:
 			/* Already unescaped. */
-			return (gchar *)elem->data;
+			return g_strdup((gchar *)elem->data);
 
 		default:
 			purple_debug_info("msim", "msim_msg_get_string: type %d unknown, name %s\n",
--- a/libpurple/protocols/myspace/myspace.c	Wed Jul 04 22:48:52 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Thu Jul 05 00:29:25 2007 +0000
@@ -1102,8 +1102,8 @@
 		return;
 	}
 
+	msim_msg_free(msg);
 	purple_debug_info("msim", "msim_get_info_cb: got for user: %s\n", user);
-	msim_msg_free(msg);
 
 	body_str = msim_msg_get_string(user_info_msg, "body");
     g_return_if_fail(body_str != NULL);
@@ -1117,7 +1117,7 @@
 	user_info = purple_notify_user_info_new();
 
 	/* Identification */
-	purple_notify_user_info_add_pair(user_info, _("User"), g_strdup(user));
+	purple_notify_user_info_add_pair(user_info, _("User"), user);
 
 	/* note: g_hash_table_lookup does not create a new string! */
 	str = g_hash_table_lookup(body, "UserID");
--- a/libpurple/protocols/myspace/myspace.h	Wed Jul 04 22:48:52 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.h	Thu Jul 05 00:29:25 2007 +0000
@@ -88,7 +88,7 @@
 #define MSIM_PORT           1863        /* TODO: alternate ports and automatic */
 
 /* Time between keepalives (seconds) - if no data within this time, is dead. */
-#define MSIM_KEEPALIVE_INTERVAL         (2 * 60)
+#define MSIM_KEEPALIVE_INTERVAL         (3 * 60)
 
 /* Time to check if alive (milliseconds) */
 #define MSIM_KEEPALIVE_INTERVAL_CHECK   (30 * 1000)