From 5535a47f4c2b9def68356d1ced9a149a7197f32c Mon Sep 17 00:00:00 2001 From: dequis Date: Thu, 7 May 2015 20:04:47 -0300 Subject: More coverity fixes! CID 18634: 'Logically dead code' in jabber_get_info CID 18638: 'Dereference after null check' in oauth2_access_token_done CID 18691: 'Copy into fixed size buffer' in bee_irc_user_new CID 20274: Leak in bee_irc_chat_invite CID 20297, CID 20283: Leaks in crypt_main Some the base64 leaks there weren't detected, needs modeling. --- lib/oauth2.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/oauth2.c') diff --git a/lib/oauth2.c b/lib/oauth2.c index d6cf9a53..f9acd6c8 100644 --- a/lib/oauth2.c +++ b/lib/oauth2.c @@ -139,9 +139,15 @@ static void oauth2_access_token_done(struct http_request *req) { struct oauth2_access_token_data *cb_data = req->data; char *atoken = NULL, *rtoken = NULL, *error = NULL; - char *content_type; + char *content_type = NULL; - if (getenv("BITLBEE_DEBUG") && req->reply_body) { + if (req->status_code <= 0 && !req->reply_body) { + cb_data->func(cb_data->data, NULL, NULL, req->status_string); + g_free(cb_data); + return; + } + + if (getenv("BITLBEE_DEBUG")) { printf("%s\n", req->reply_body); } -- cgit v1.2.3