Mercurial > pidgin.yaz
changeset 22458:22fce0be8ed0
Fix a memory leak
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Thu, 13 Mar 2008 01:24:21 +0000 |
parents | 34b8d1107b06 |
children | 0daeabc1a185 |
files | libpurple/plugins/joinpart.c |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/plugins/joinpart.c Wed Mar 12 01:38:51 2008 +0000 +++ b/libpurple/plugins/joinpart.c Thu Mar 13 01:24:21 2008 +0000 @@ -77,7 +77,7 @@ { 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 @@ 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);