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/Non-IM Contact | |
parent | 541eab20530165d10592a9fda590f435c6a8b4be (diff) |
NLHR_PTR - smart pointers make better code
Diffstat (limited to 'protocols/Non-IM Contact')
-rw-r--r-- | protocols/Non-IM Contact/src/http.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/protocols/Non-IM Contact/src/http.cpp b/protocols/Non-IM Contact/src/http.cpp index a7eaca69cb..55e648c248 100644 --- a/protocols/Non-IM Contact/src/http.cpp +++ b/protocols/Non-IM Contact/src/http.cpp @@ -48,7 +48,7 @@ int InternetDownloadFile(char *szUrl) nlhr.headers[nlhr.headersCount - 1].szValue = NETLIB_USER_AGENT; // download the page - NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(hNetlibUser, &nlhr); + NLHR_PTR nlhrReply(Netlib_HttpTransaction(hNetlibUser, &nlhr)); if (nlhrReply) { // return error code if the recieved code is neither 200 OK or 302 Moved if (nlhrReply->resultCode != 200 && nlhrReply->resultCode != 302) @@ -81,7 +81,6 @@ int InternetDownloadFile(char *szUrl) // make a copy of the retrieved data, then free the memory of the http reply szInfo = szData; - Netlib_FreeHttpRequest(nlhrReply); // the recieved data is empty, data was not recieved, so return an error code of 1 if (!mir_strcmp(szInfo, "")) return 1; |