pidgin: 28f92254: Don't use pointers (even opaquely) once ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sun Aug 2 01:40:47 EDT 2009


-----------------------------------------------------------------
Revision: 28f92254cc16ea2b606c45aa412968785f8e3ba1
Ancestor: 248addd0286fe0c7b5d98b6766a30e184d27ce2f
Author: darkrain42 at pidgin.im
Date: 2009-08-02T05:34:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/28f92254cc16ea2b606c45aa412968785f8e3ba1

Modified files:
        libpurple/protocols/bonjour/mdns_avahi.c
        libpurple/protocols/jabber/disco.c
        libpurple/protocols/jabber/si.c
        libpurple/protocols/yahoo/yahoo_packet.c libpurple/signals.c
        pidgin/gtkblist.c pidgin/gtkimhtml.c pidgin/gtkthemes.c

ChangeLog: 

Don't use pointers (even opaquely) once they're freed. Closes #9822.

-------------- next part --------------
============================================================
--- libpurple/protocols/bonjour/mdns_avahi.c	6a7d0b2a3d91743878de47253685773b72e74926
+++ libpurple/protocols/bonjour/mdns_avahi.c	864564a98c901e99ad8d82708f99a3c6056fcced
@@ -200,8 +200,8 @@ _resolver_callback(AvahiServiceResolver 
 			}
 
 			if (!bonjour_buddy_check(bb)) {
+				b_impl->resolvers = g_slist_remove(b_impl->resolvers, rd);
 				_cleanup_resolver_data(rd);
-				b_impl->resolvers = g_slist_remove(b_impl->resolvers, rd);
 				/* If this was the last resolver, remove the buddy */
 				if (b_impl->resolvers == NULL) {
 					if (pb != NULL)
============================================================
--- libpurple/protocols/jabber/disco.c	b39cecfcf83d180fb0ecbaa5eeb7087852e21d34
+++ libpurple/protocols/jabber/disco.c	751f7b4a244b85c3bf15875c152366fb1375d418
@@ -85,11 +85,11 @@ jabber_disco_bytestream_server_cb(Jabber
 
 	/* TODO: When we support zeroconf proxies, fix this to handle them */
 	if (!(sh->jid && sh->host && sh->port > 0)) {
+		js->bs_proxies = g_list_remove(js->bs_proxies, sh);
 		g_free(sh->jid);
 		g_free(sh->host);
 		g_free(sh->zeroconf);
 		g_free(sh);
-		js->bs_proxies = g_list_remove(js->bs_proxies, sh);
 	}
 }
 
============================================================
--- libpurple/protocols/jabber/si.c	f520500ba5bc9a90ff7fa192058afca8fb96c5c7
+++ libpurple/protocols/jabber/si.c	82802a7bd534a71353e535746666c03a6b4ee33a
@@ -1348,6 +1348,8 @@ static void jabber_si_xfer_free(PurpleXf
 			fclose(jsx->fp);
 		}
 
+		purple_debug_info("jabber", "jabber_si_xfer_free(): freeing jsx %p\n", jsx);
+
 		g_free(jsx->stream_id);
 		g_free(jsx->iq_id);
 		/* XXX: free other stuff */
@@ -1355,7 +1357,6 @@ static void jabber_si_xfer_free(PurpleXf
 		g_free(jsx);
 		xfer->data = NULL;
 
-		purple_debug_info("jabber", "jabber_si_xfer_free(): freeing jsx %p\n", jsx);
 	}
 }
 
============================================================
--- libpurple/protocols/yahoo/yahoo_packet.c	e3deb1c1d0d4e0631cde2d70267928f2b99b4961
+++ libpurple/protocols/yahoo/yahoo_packet.c	28dbeb27d2900b9e6801791e9c666c5df9fdda8f
@@ -397,7 +397,7 @@ void yahoo_packet_free(struct yahoo_pack
 		struct yahoo_pair *pair = pkt->hash->data;
 		g_free(pair->value);
 		g_free(pair);
-		pkt->hash = g_slist_remove(pkt->hash, pair);
+		pkt->hash = g_slist_delete_link(pkt->hash, pkt->hash);
 	}
 	g_free(pkt);
 }
============================================================
--- libpurple/signals.c	b45610a2a29f17768cee6119e1ac478b579e79cb
+++ libpurple/signals.c	060a54e191f5e7eebc240ad2aad9849415514ac2
@@ -363,8 +363,8 @@ purple_signal_disconnect(void *instance,
 		{
 			g_free(handler_data);
 
-			signal_data->handlers = g_list_remove(signal_data->handlers,
-												  handler_data);
+			signal_data->handlers = g_list_delete_link(signal_data->handlers,
+												       l);
 			signal_data->handler_count--;
 
 			found = TRUE;
@@ -398,8 +398,8 @@ disconnect_handle_from_signals(const cha
 			g_free(handler_data);
 
 			signal_data->handler_count--;
-			signal_data->handlers = g_list_remove(signal_data->handlers,
-												  handler_data);
+			signal_data->handlers = g_list_delete_link(signal_data->handlers,
+			                                           l);
 		}
 	}
 }
============================================================
--- pidgin/gtkblist.c	d72565d1e2367cedb39daa63937aba3a5ac0d208
+++ pidgin/gtkblist.c	1b1969a6dadb65c559be512c2414e9b525eee343
@@ -3560,7 +3560,7 @@ static char *pidgin_get_tooltip_text(Pur
 			}
 
 			g_free(pce);
-			cur = g_list_remove(cur, pce);
+			cur = g_list_delete_link(cur, cur);
 		}
 	}
 	else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node))
============================================================
--- pidgin/gtkimhtml.c	7cd12524ee7ca8d20e19c2cff67987348cd04f14
+++ pidgin/gtkimhtml.c	ac2961959edfc35e44eac7d5b9a424278f369492
@@ -5838,9 +5838,9 @@ gboolean gtk_imhtml_class_register_proto
 		if (activate) {
 			return FALSE;
 		}
+		klass->protocols = g_list_remove(klass->protocols, proto);
 		g_free(proto->name);
 		g_free(proto);
-		klass->protocols = g_list_remove(klass->protocols, proto);
 		return TRUE;
 	} else if (!activate) {
 		return FALSE;
============================================================
--- pidgin/gtkthemes.c	3363485cb24f7bc51a9b83780d452673f909a534
+++ pidgin/gtkthemes.c	511ee3eaea819c80f2f11300c351094ebd3753a4
@@ -183,7 +183,7 @@ pidgin_themes_destroy_smiley_theme_smile
 			}
 			g_free(uio->smile);
 			g_free(uio);
-			wer->smileys = g_slist_remove(wer->smileys, uio);
+			wer->smileys = g_slist_delete_link(wer->smileys, wer->smileys);
 		}
 		theme->list = wer->next;
 		g_free(wer->sml);


More information about the Commits mailing list