pidgin: 8591cff6: Avoid allocating and freeing stuff unnec...

datallah at pidgin.im datallah at pidgin.im
Fri Apr 25 14:06:05 EDT 2008


-----------------------------------------------------------------
Revision: 8591cff66d2b598fd98ef844ad0c89c5bb1d307f
Ancestor: 6c9a19d4cee476886c37311e8bb9020f7027cbb6
Author: datallah at pidgin.im
Date: 2008-04-25T18:01:50
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8591cff66d2b598fd98ef844ad0c89c5bb1d307f

Modified files:
        libpurple/protocols/irc/msgs.c

ChangeLog: 

Avoid allocating and freeing stuff unnecessarily.

-------------- next part --------------
============================================================
--- libpurple/protocols/irc/msgs.c	ed0919bc4e502981321e955cf3c642e6492fec01
+++ libpurple/protocols/irc/msgs.c	a7f1f2177dc2a58e69d44808e45cd1219d425411
@@ -706,15 +706,15 @@ void irc_msg_invite(struct irc_conn *irc
 void irc_msg_invite(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	PurpleConnection *gc = purple_account_get_connection(irc->account);
-	GHashTable *components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
-	char *nick = irc_mask_nick(from);
+	GHashTable *components;
+	gchar *nick;
 
-	if (!args || !args[1] || !gc) {
-		g_free(nick);
-		g_hash_table_destroy(components);
+	if (!args || !args[1] || !gc)
 		return;
-	}
 
+	components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+	nick = irc_mask_nick(from);
+
 	g_hash_table_insert(components, g_strdup("channel"), g_strdup(args[1]));
 
 	serv_got_chat_invite(gc, args[1], nick, NULL, components);


More information about the Commits mailing list