diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-24 14:30:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-24 14:30:13 +0300 |
commit | 103de9c164934b2393dfcba7011625f90c8a2097 (patch) | |
tree | f7a4a09afe29398f3b7605d7d0db264638a18150 /protocols/GmailNotifier/src | |
parent | 541eab20530165d10592a9fda590f435c6a8b4be (diff) |
NLHR_PTR - smart pointers make better code
Diffstat (limited to 'protocols/GmailNotifier/src')
-rw-r--r-- | protocols/GmailNotifier/src/check.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/protocols/GmailNotifier/src/check.cpp b/protocols/GmailNotifier/src/check.cpp index 06a1926ef1..d9386b191b 100644 --- a/protocols/GmailNotifier/src/check.cpp +++ b/protocols/GmailNotifier/src/check.cpp @@ -80,18 +80,14 @@ void CheckMailInbox(Account *curAcc) nlr.dataLength = szBody.GetLength(); nlr.pData = szBody.GetBuffer(); - NETLIBHTTPREQUEST *nlu = Netlib_HttpTransaction(hNetlibUser, &nlr); + NLHR_PTR nlu(Netlib_HttpTransaction(hNetlibUser, &nlr)); if (nlu == nullptr || nlu->resultCode != 200) { mir_strcpy(curAcc->results.content, Translate("Can't send account data!")); - Netlib_FreeHttpRequest(nlu); curAcc->results_num = -1; mir_strcat(curAcc->results.content, "]"); curAcc->IsChecking = false; - return; } - - Netlib_FreeHttpRequest(nlu); } // go! @@ -115,11 +111,10 @@ void CheckMailInbox(Account *curAcc) nlr.headers = headers; nlr.headersCount = _countof(headers); - NETLIBHTTPREQUEST *nlu = Netlib_HttpTransaction(hNetlibUser, &nlr); + NLHR_PTR nlu(Netlib_HttpTransaction(hNetlibUser, &nlr)); if (nlu == nullptr) { mir_snprintf(curAcc->results.content, "%s [%s]", szNick.get(), (nlr.resultCode == 401) ? Translate("Wrong name or password!") : Translate("Can't get RSS feed!")); - Netlib_FreeHttpRequest(nlu); curAcc->results_num = -1; curAcc->IsChecking = false; |