pidgin: bda22ced: Fix a memory leak

nosnilmot at pidgin.im nosnilmot at pidgin.im
Wed Mar 12 21:41:03 EDT 2008


-----------------------------------------------------------------
Revision: bda22ced802132e741a614cf3e67a599e9b08b0c
Ancestor: c828bc32e00b89aaf677ddacdea358c180e3a149
Author: nosnilmot at pidgin.im
Date: 2008-03-13T01:24:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/bda22ced802132e741a614cf3e67a599e9b08b0c

Modified files:
        libpurple/plugins/joinpart.c

ChangeLog: 

Fix a memory leak

-------------- next part --------------
============================================================
--- libpurple/plugins/joinpart.c	07b73f22290babb846bcf517000f679577895228
+++ libpurple/plugins/joinpart.c	4a66ac5df877da099ae88c03760bdbd7ab9300e2
@@ -77,7 +77,7 @@ static gboolean should_hide_notice(Purpl
 {
 	PurpleConvChat *chat;
 	int threshold;
-	struct joinpart_key *key;
+	struct joinpart_key key;
 	time_t *last_said;
 
 	g_return_val_if_fail(conv != NULL, FALSE);
@@ -94,10 +94,9 @@ static gboolean should_hide_notice(Purpl
 		return FALSE;
 
 	/* Only show the notice if the user has spoken recently. */
-	key = g_new(struct joinpart_key, 1);
-	key->conv = conv;
-	key->user = g_strdup(name);
-	last_said = g_hash_table_lookup(users, key);
+	key.conv = conv;
+	key.user = (gchar *)name;
+	last_said = g_hash_table_lookup(users, &key);
 	if (last_said != NULL)
 	{
 		int delay = purple_prefs_get_int(DELAY_PREF);


More information about the Commits mailing list