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/MSN/src/msn_auth.cpp | |
parent | 541eab20530165d10592a9fda590f435c6a8b4be (diff) |
NLHR_PTR - smart pointers make better code
Diffstat (limited to 'protocols/MSN/src/msn_auth.cpp')
-rw-r--r-- | protocols/MSN/src/msn_auth.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index 176c42f1f9..c2956d09af 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -287,10 +287,9 @@ bool SkypeToken::Refresh(bool bForce) nlhr.pData = szPOST.GetBuffer();
m_proto->mHttpsTS = clock();
- NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(m_proto->m_hNetlibUser, &nlhr);
+ NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_proto->m_hNetlibUser, &nlhr));
m_proto->mHttpsTS = clock();
- bool bRet = false;
if (nlhrReply) {
m_proto->hHttpsConnection = nlhrReply->nlc;
@@ -303,14 +302,13 @@ bool SkypeToken::Refresh(bool bForce) if (tExpires == 0)
tExpires = 86400;
SetToken("skype_token " + szToken, time(0) + tExpires);
- bRet = true;
+ return true;
}
}
}
- Netlib_FreeHttpRequest(nlhrReply);
}
else m_proto->hHttpsConnection = nullptr;
- return bRet;
+ return false;
}
const char* SkypeToken::XSkypetoken()
@@ -698,7 +696,7 @@ bool CMsnProto::RefreshOAuth(const char *pszRefreshToken, const char *pszService // Query
mHttpsTS = clock();
- NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(m_hNetlibUser, &nlhr);
+ NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
mHttpsTS = clock();
if (nlhrReply) {
hHttpsConnection = nlhrReply->nlc;
@@ -728,7 +726,6 @@ bool CMsnProto::RefreshOAuth(const char *pszRefreshToken, const char *pszService }
}
}
- Netlib_FreeHttpRequest(nlhrReply);
}
else hHttpsConnection = nullptr;
return bRet;
|