aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-06-24 02:06:49 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-06-24 02:06:49 +0100
commit38ff846b14f1d1f80983a0818b9bcf60581a2a34 (patch)
treee2a2e7e53e091e9e919e6bcb6c8b4ccf502b90d6
parentd6aa6dd53c3352305508ffbf62d26f59dd19b777 (diff)
Fixed an access-after-free() bug in the Jabber keepalive + cache cleanup
code.
-rw-r--r--protocols/jabber/jabber.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index 48b8ac43..75351d0d 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -473,7 +473,8 @@ static void jabber_chat_invite_( struct groupchat *c, char *who, char *msg )
static void jabber_keepalive( struct im_connection *ic )
{
/* Just any whitespace character is enough as a keepalive for XMPP sessions. */
- jabber_write( ic, "\n", 1 );
+ if( !jabber_write( ic, "\n", 1 ) )
+ return;
/* This runs the garbage collection every minute, which means every packet
is in the cache for about a minute (which should be enough AFAIK). */