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 /plugins/HTTPServer/src/GuiElements.cpp | |
parent | 541eab20530165d10592a9fda590f435c6a8b4be (diff) |
NLHR_PTR - smart pointers make better code
Diffstat (limited to 'plugins/HTTPServer/src/GuiElements.cpp')
-rw-r--r-- | plugins/HTTPServer/src/GuiElements.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 285cc7595f..ebb4f0587f 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -151,7 +151,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) IN_ADDR externIP;
externIP.s_addr = 0;
- NETLIBHTTPREQUEST *nlreply = Netlib_HttpTransaction(hNetlibUser, &nlhr);
+ NLHR_PTR nlreply(Netlib_HttpTransaction(hNetlibUser, &nlhr));
if (nlreply) {
if (nlreply->resultCode >= 200 && nlreply->resultCode < 300) {
nlreply->pData[nlreply->dataLength] = 0;// make sure its null terminated
@@ -171,7 +171,6 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) if ((externIP.s_addr = inet_addr(pszIp)) == INADDR_NONE)
externIP.s_addr = 0;
}
- Netlib_FreeHttpRequest(nlreply);
}
::SetCursor(hPrevCursor);
return ntohl(externIP.s_addr);
|