aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter_lib.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-12-26 19:17:51 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2011-12-26 19:17:51 +0100
commit199fea6629504aac602c0c11782833b7354e629e (patch)
treec675b20628524042a4fb26e425938d1459acff5c /protocols/twitter/twitter_lib.c
parent5f40da79f78e444f08387ce53da1b2e471c8552f (diff)
Fixing memory leak in Twitter module.
Diffstat (limited to 'protocols/twitter/twitter_lib.c')
-rw-r--r--protocols/twitter/twitter_lib.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index d52c29ff..699bac27 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -3,7 +3,8 @@
* BitlBee - An IRC to IM gateway *
* Simple module to facilitate twitter functionality. *
* *
-* Copyright 2009 Geert Mulders <g.c.w.m.mulders@gmail.com> *
+* Copyright 2009-2010 Geert Mulders <g.c.w.m.mulders@gmail.com> *
+* Copyright 2010-2011 Wilmer van der Gaast <wilmer@gaast.net> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
@@ -785,15 +786,11 @@ void twitter_flush_timeline(struct im_connection *ic)
g_slist_free(output);
- if (home_timeline && home_timeline->list) {
- txl_free(home_timeline);
- }
-
- if (mentions && mentions->list) {
- txl_free(mentions);
- }
+ txl_free(home_timeline);
+ txl_free(mentions);
td->flags &= ~(TWITTER_DOING_TIMELINE | TWITTER_GOT_TIMELINE | TWITTER_GOT_MENTIONS);
+ td->home_timeline_obj = td->mentions_obj = NULL;
}
/**
@@ -803,6 +800,7 @@ void twitter_get_home_timeline(struct im_connection *ic, gint64 next_cursor)
{
struct twitter_data *td = ic->proto_data;
+ txl_free(td->home_timeline_obj);
td->home_timeline_obj = NULL;
td->flags &= ~TWITTER_GOT_TIMELINE;
@@ -838,6 +836,7 @@ void twitter_get_mentions(struct im_connection *ic, gint64 next_cursor)
{
struct twitter_data *td = ic->proto_data;
+ txl_free(td->mentions_obj);
td->mentions_obj = NULL;
td->flags &= ~TWITTER_GOT_MENTIONS;