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/MinecraftDynmap/src | |
parent | 541eab20530165d10592a9fda590f435c6a8b4be (diff) |
NLHR_PTR - smart pointers make better code
Diffstat (limited to 'protocols/MinecraftDynmap/src')
-rw-r--r-- | protocols/MinecraftDynmap/src/communication.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/protocols/MinecraftDynmap/src/communication.cpp b/protocols/MinecraftDynmap/src/communication.cpp index b8131f51bf..0366b5e9cb 100644 --- a/protocols/MinecraftDynmap/src/communication.cpp +++ b/protocols/MinecraftDynmap/src/communication.cpp @@ -81,13 +81,12 @@ http::response MinecraftDynmapProto::sendRequest(const int request_type, std::st debugLogA("@@@@@ Sending request to '%s'", nlhr.szUrl); // Send the request - NETLIBHTTPREQUEST *pnlhr = Netlib_HttpTransaction(m_hNetlibUser, &nlhr); + NLHR_PTR pnlhr(Netlib_HttpTransaction(m_hNetlibUser, &nlhr)); mir_free(nlhr.headers); // Remember the persistent connection handle (or not) - switch (request_type) - { + switch (request_type) { case MINECRAFTDYNMAP_REQUEST_HOME: break; @@ -110,8 +109,6 @@ http::response MinecraftDynmapProto::sendRequest(const int request_type, std::st resp.data = pnlhr->pData ? pnlhr->pData : ""; // debugLogA("&&&&& Got response: %s", resp.data.c_str()); - - Netlib_FreeHttpRequest(pnlhr); } else { debugLogA("!!!!! No response from server (time-out)"); resp.code = HTTP_CODE_FAKE_DISCONNECTED; |