pidgin/purple-plugin-pack

e20719bdb45b
Parents 9f457ac0d62c
Children 9d1bb65b7fc0
Plug a leak and more tightly scope some code.

==21150== by 0x90C0DCD: g_slist_prepend (gslist.c:160)
==21150== by 0x9379586: purple_find_buddies (blist.c:2488)
==21150== by 0x14AFAE15: historize (enhancedhist.c:128)
--- a/enhancedhist/enhancedhist.c Sun Oct 25 21:04:22 2009 -0700
+++ b/enhancedhist/enhancedhist.c Sun Oct 25 21:14:04 2009 -0700
@@ -89,7 +89,6 @@
GtkTextIter start;
GtkIMHtmlOptions options;
GList *logs = NULL, *logs_head = NULL;
- GSList *buddies = NULL;
struct tm *log_tm = NULL, *local_tm = NULL;
time_t t, log_time;
double limit_time = 0.0;
@@ -124,18 +123,19 @@
options = GTK_IMHTML_NO_COLOURS;
}
- /* Find buddies for this conversation. */
- buddies = purple_find_buddies(account, name);
-
- /* If we found at least one buddy, save the first buddy's alias. */
- if (buddies != NULL)
- alias = purple_buddy_get_contact_alias((PurpleBuddy *)buddies->data);
-
/* Determine whether this is an IM or a chat. In either case, if the user has that
* particular log type disabled, the logs file doesnt not get specified */
convtype = purple_conversation_get_type(c);
if (convtype == PURPLE_CONV_TYPE_IM && PREF_IM_VAL) {
GSList *cur;
+ GSList *buddies = NULL;
+
+ /* Find buddies for this conversation. */
+ buddies = purple_find_buddies(account, name);
+
+ /* If we found at least one buddy, save the first buddy's alias. */
+ if (buddies != NULL)
+ alias = purple_buddy_get_contact_alias((PurpleBuddy *)buddies->data);
for(cur = buddies; cur; cur = cur->next) {
PurpleBlistNode *node = cur->data;
@@ -153,6 +153,8 @@
}
}
+ g_slist_free(buddies);
+
if (logs)
logs = g_list_sort(logs, purple_log_compare);
else