Changeset a244877


Ignore:
Timestamp:
2016-04-17T09:32:27Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
720f7a9
Parents:
991c75f
Message:

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.

Location:
protocols/twitter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    r991c75f ra244877  
    687687                }
    688688
     689                g_slist_foreach(td->mutes_ids, (GFunc) g_free, NULL);
     690                g_slist_free(td->mutes_ids);
     691
     692                g_slist_foreach(td->noretweets_ids, (GFunc) g_free, NULL);
     693                g_slist_free(td->noretweets_ids);
     694
    689695                http_close(td->stream);
    690696                twitter_filter_remove_all(ic);
  • protocols/twitter/twitter_lib.c

    r991c75f ra244877  
    955955        /* Check this is not a tweet that should be muted */
    956956        uid_str = g_strdup_printf("%" PRIu64, status->user->uid);
    957         if (getenv("BITLBEE_DEBUG")) {
    958                 GSList *item;
    959                 fprintf(stderr, "Checking mutes; this uid=%s\n", uid_str);
    960                 for (item = td->mutes_ids; item != NULL; item = item->next) {
    961                         fprintf(stderr, "  id: %s\n", (char *)item->data);
    962                 }
    963         }
     957
    964958        if (g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp)) {
    965959                g_free(uid_str);
     
    11641158                if ((found = g_slist_find_custom(td->mutes_ids, uid_str,
    11651159                                                (GCompareFunc)strcmp))) {
    1166                         td->mutes_ids = g_slist_remove(td->mutes_ids, found);
     1160                        char *found_str = found->data;
     1161                        td->mutes_ids = g_slist_delete_link(td->mutes_ids, found);
     1162                        g_free(found_str);
    11671163                }
    11681164                g_free(uid_str);
Note: See TracChangeset for help on using the changeset viewer.