From 103de9c164934b2393dfcba7011625f90c8a2097 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 24 Jul 2019 14:30:13 +0300 Subject: NLHR_PTR - smart pointers make better code --- protocols/CurrencyRates/src/HTTPSession.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'protocols/CurrencyRates') diff --git a/protocols/CurrencyRates/src/HTTPSession.cpp b/protocols/CurrencyRates/src/HTTPSession.cpp index 22c34867c5..004450736f 100644 --- a/protocols/CurrencyRates/src/HTTPSession.cpp +++ b/protocols/CurrencyRates/src/HTTPSession.cpp @@ -26,7 +26,7 @@ bool CHTTPSession::OpenURL(const tstring &rsURL) return true; } -bool CHTTPSession::ReadResponce(tstring& rsResponce) +bool CHTTPSession::ReadResponce(tstring &rsResponce) { if (m_szUrl.IsEmpty()) return false; @@ -48,7 +48,7 @@ bool CHTTPSession::ReadResponce(tstring& rsResponce) nlhr.headers = headers; bool bResult = false; - NETLIBHTTPREQUEST *pReply = nullptr; + NLHR_PTR pReply(0); { mir_cslock lck(m_mx); pReply = Netlib_HttpTransaction(g_hNetLib, &nlhr); @@ -65,8 +65,6 @@ bool CHTTPSession::ReadResponce(tstring& rsResponce) bResult = true; } - - Netlib_FreeHttpRequest(pReply); } return bResult; } -- cgit v1.2.3