From 9c4ba307862a3408c67a55bd0c003b6f0f2bdc7d Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Mon, 8 Jun 2015 12:03:44 +0000 Subject: SkypeWeb: Memleaks fix (detected by coverity). git-svn-id: http://svn.miranda-ng.org/main/trunk@14066 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_login.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'protocols/SkypeWeb/src/skype_login.cpp') diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 063360f894..97d0eedce3 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -57,6 +57,7 @@ void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response) if (response->resultCode != 200) { + int error = 0; if (!json["status"].isnull()) { const JSONNode &status = json["status"]; @@ -64,25 +65,34 @@ void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response) { switch(status["code"].as_int()) { + case 40002: + { + ShowNotification(_T("Skype"), TranslateT("Authentication failed. Invalid username."), NULL, 1); + error = LOGINERR_BADUSERID; + break; + } case 40120: { ShowNotification(_T("Skype"), TranslateT("Authentication failed. Bad username or password."), NULL, 1); + error = LOGINERR_WRONGPASSWORD; break; } case 40121: { ShowNotification(_T("Skype"), TranslateT("Too many failed authentication attempts with given username or IP."), NULL, 1); + error = LOGIN_ERROR_TOOMANY_REQUESTS; break; } default: { ShowNotification(_T("Skype"), !status["text"].isnull() ? status["text"].as_mstring().GetBuffer() : TranslateT("Authentication failed. Unknown error."), NULL, 1); + error = LOGIN_ERROR_UNKNOWN; } } } } - ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); + ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, error); SetStatus(ID_STATUS_OFFLINE); return; } -- cgit v1.2.3