diff options
author | dequis <dx@dxzone.com.ar> | 2016-04-17 06:32:27 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2016-04-17 06:32:27 -0300 |
commit | a244877191da5159d56e34dca57e881a639061ce (patch) | |
tree | f33708227143b53e256d84c8900a56f573b4e067 /protocols/twitter/twitter_lib.c | |
parent | 991c75fbf4c4bc0ab2ae6f8b983a092080630b14 (diff) |
twitter: Fix a couple of leaks of mutes_ids and retweets_ids
Just freeing the list on logout and when removing items from them.
Also remove the "checking mutes" debug which is disproportionately noisy
compared to the rest of the protocol.
Diffstat (limited to 'protocols/twitter/twitter_lib.c')
-rw-r--r-- | protocols/twitter/twitter_lib.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index 82765201..77f487ae 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -954,13 +954,7 @@ static void twitter_status_show(struct im_connection *ic, struct twitter_xml_sta /* Check this is not a tweet that should be muted */ uid_str = g_strdup_printf("%" PRIu64, status->user->uid); - if (getenv("BITLBEE_DEBUG")) { - GSList *item; - fprintf(stderr, "Checking mutes; this uid=%s\n", uid_str); - for (item = td->mutes_ids; item != NULL; item = item->next) { - fprintf(stderr, " id: %s\n", (char *)item->data); - } - } + if (g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp)) { g_free(uid_str); return; @@ -1163,7 +1157,9 @@ static gboolean twitter_stream_handle_event(struct im_connection *ic, json_value uid_str = g_strdup_printf("%" PRIu64, ut->uid); if ((found = g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp))) { - td->mutes_ids = g_slist_remove(td->mutes_ids, found); + char *found_str = found->data; + td->mutes_ids = g_slist_delete_link(td->mutes_ids, found); + g_free(found_str); } g_free(uid_str); twitter_log(ic, "Unmuted user %s", ut->screen_name); |