changeset 22715:8d3c68a8eed4

Avoid allocating and freeing stuff unnecessarily.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 25 Apr 2008 18:01:50 +0000
parents 645423a7a7b6
children c4d1689afe20
files libpurple/protocols/irc/msgs.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/irc/msgs.c	Fri Apr 25 17:57:54 2008 +0000
+++ b/libpurple/protocols/irc/msgs.c	Fri Apr 25 18:01:50 2008 +0000
@@ -706,14 +706,14 @@
 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]));