pidgin: aafbbc31: Leak fixes.

datallah at pidgin.im datallah at pidgin.im
Fri May 2 18:05:43 EDT 2008


-----------------------------------------------------------------
Revision: aafbbc317ab5f69e31e0bb6cabc264bb70745ef2
Ancestor: 30ffdc24c362a88ea84a371324420ea3366c9677
Author: datallah at pidgin.im
Date: 2008-05-02T22:01:01
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/aafbbc317ab5f69e31e0bb6cabc264bb70745ef2

Modified files:
        libpurple/protocols/yahoo/yahoo_aliases.c
        libpurple/protocols/yahoo/yahoo_filexfer.c

ChangeLog: 

Leak fixes.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo_aliases.c	59779f875ea95c7204d791e7f9f9efecf405b806
+++ libpurple/protocols/yahoo/yahoo_aliases.c	40d761acaf7a13a6ec8bc51f59af138843713e31
@@ -68,7 +68,8 @@ yahoo_fetch_aliases_cb(PurpleUtilFetchUr
 		purple_debug_info("yahoo", "No Aliases to process.%s%s\n",
 						  error_message ? " Error:" : "", error_message ? error_message : "");
 	} else {
-		const char *yid, *full_name, *nick_name, *alias, *id, *fn, *ln, *nn;
+		gchar *full_name, *nick_name, *alias;
+		const char *yid, *id, *fn, *ln, *nn;
 		PurpleBuddy *b = NULL;
 		xmlnode *item, *contacts;
 
@@ -92,7 +93,9 @@ yahoo_fetch_aliases_cb(PurpleUtilFetchUr
 				nn = xmlnode_get_attrib(item,"nn");
 				id = xmlnode_get_attrib(item,"id");
 
-		                /* Yahoo stores first and last names separately, lets put them together into a full name */
+				full_name = nick_name = alias = NULL;
+
+				/* Yahoo stores first and last names separately, lets put them together into a full name */
 				if (yd->jp)
 					full_name = g_strstrip(g_strdup_printf("%s %s", (ln != NULL ? ln : "") , (fn != NULL ? fn : "")));
 				else
@@ -103,8 +106,6 @@ yahoo_fetch_aliases_cb(PurpleUtilFetchUr
 					alias = nick_name;   /* If we have a nickname from Yahoo, let's use it */
 				else if (strlen(full_name) != 0)
 					alias = full_name;  /* If no Yahoo nickname, we can use the full_name created above */
-				else
-					alias = NULL;  /* No nickname, first name or last name, then you get no alias !!  */
 
 				/*  Find the local buddy that matches */
 				b = purple_find_buddy(cb->gc->account, yid);
@@ -118,6 +119,7 @@ yahoo_fetch_aliases_cb(PurpleUtilFetchUr
 					yu->firstname = g_strdup(fn);
 					yu->lastname = g_strdup(ln);
 					yu->nickname = g_strdup(nn);
+					/* TODO: Isn't there a possiblity that b->proto_data is already set? */
 					b->proto_data=yu;
 
 					/* Finally, if we received an alias, we better update the buddy list */
@@ -132,6 +134,9 @@ yahoo_fetch_aliases_cb(PurpleUtilFetchUr
 				} else {
 					purple_debug_info("yahoo", "Bizarre, received alias for %s, but they are not on your list...\n", yid);
 				}
+
+				g_free(full_name);
+				g_free(nick_name);
 			}
 		}
 		xmlnode_free(contacts);
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	781119f6911c43edc1d6046cb10069ab6b2b1ab1
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	95928ffcefe44c764f487d2a2a535f23c1c1c04d
@@ -998,6 +998,7 @@ static void yahoo_xfer_dns_connected_15(
 	url = g_strdup_printf("%ld.%ld.%ld.%ld", d, c, b, a);
 	if (!purple_url_parse(url, &(xd->host), &(xd->port), &(xd->path), NULL, NULL)) {
 		purple_xfer_cancel_remote(xfer);
+		g_free(url);
 		return;
 	}
 	g_free(url);


More information about the Commits mailing list