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/Discord/src/connection.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'protocols/Discord') diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp index da7f777d59..1842fe1331 100644 --- a/protocols/Discord/src/connection.cpp +++ b/protocols/Discord/src/connection.cpp @@ -41,15 +41,13 @@ void CDiscordProto::ExecuteRequest(AsyncHttpRequest *pReq) } debugLogA("Executing request #%d:\n%s", pReq->m_iReqNum, pReq->szUrl); - NETLIBHTTPREQUEST *reply = Netlib_HttpTransaction(m_hNetlibUser, pReq); + NLHR_PTR reply(Netlib_HttpTransaction(m_hNetlibUser, pReq)); if (reply != nullptr) { if (pReq->m_pFunc != nullptr) (this->*(pReq->m_pFunc))(reply, pReq); if (pReq->m_bMainSite) m_hAPIConnection = reply->nlc; - - Netlib_FreeHttpRequest(reply); } else { debugLogA("Request %d failed", pReq->m_iReqNum); -- cgit v1.2.3