diff libpurple/protocols/jabber/caps.c @ 19721:5c419cd2cd22

Fix crash in XMPP capabilities
author Sean Egan <seanegan@gmail.com>
date Mon, 10 Sep 2007 23:45:51 +0000
parents d32ed28cf645
children 30e4912e4a27 64e0c7fa92c9
line wrap: on
line diff
--- a/libpurple/protocols/jabber/caps.c	Mon Sep 10 21:19:37 2007 +0000
+++ b/libpurple/protocols/jabber/caps.c	Mon Sep 10 23:45:51 2007 +0000
@@ -474,13 +474,13 @@
 	userdata->ver = g_strdup(ver);
 
 	if(originalext) {
-		gchar **tmp;
+		int i;
 		gchar **splat = g_strsplit(originalext, " ", 0);
-		for(tmp = splat; *tmp; tmp++) {
-			userdata->ext = g_list_append(userdata->ext, tmp);
+		for(i =0; splat[i]; i++) {
+			userdata->ext = g_list_append(userdata->ext, g_strdup(splat[i]));
 			++userdata->extOutstanding;
 		}
-		g_free(splat);
+		g_strfreev(splat);
 	}
 	g_free(originalext);