From bbff22d5c2f3a7cef28bd57c7a73379b0c5d2623 Mon Sep 17 00:00:00 2001 From: dequis Date: Thu, 8 Oct 2015 04:48:06 -0300 Subject: twitter: Fix some nitpicky issues reported by coverity Mostly minor rare leaks that happen in error conditions, and one dereference before null check in twitter_logout (the null check is probably the wrong one there, but it doesn't hurt to keep it) --- protocols/twitter/twitter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/twitter/twitter.c') diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index b619b1e5..a8103cca 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -677,14 +677,14 @@ static void twitter_logout(struct im_connection *ic) // Set the status to logged out. ic->flags &= ~OPT_LOGGED_IN; - // Remove the main_loop function from the function queue. - b_event_remove(td->main_loop_id); + if (td) { + // Remove the main_loop function from the function queue. + b_event_remove(td->main_loop_id); - if (td->timeline_gc) { - imcb_chat_free(td->timeline_gc); - } + if (td->timeline_gc) { + imcb_chat_free(td->timeline_gc); + } - if (td) { if (td->filter_update_id > 0) { b_event_remove(td->filter_update_id); } -- cgit v1.2.3