diff options
Diffstat (limited to 'plugins/PluginUpdater/src/Utils.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Utils.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index f6d23f1899..321ce1bd71 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -258,7 +258,7 @@ bool DownloadFile(FILEURL *pFileURL, HNETLIBCONN &nlc) bool ret = false;
for (int i = 0; !ret && i < MAX_RETRIES; i++) {
Netlib_LogfW(hNetlibUser,L"Downloading file %s to %s (attempt %d)",pFileURL->tszDownloadURL,pFileURL->tszDiskPath, i+1);
- NETLIBHTTPREQUEST *pReply = Netlib_HttpTransaction(hNetlibUser, &nlhr);
+ NLHR_PTR pReply(Netlib_HttpTransaction(hNetlibUser, &nlhr));
if (pReply) {
nlc = pReply->nlc;
if ((200 == pReply->resultCode) && (pReply->dataLength > 0)) {
@@ -269,7 +269,6 @@ bool DownloadFile(FILEURL *pFileURL, HNETLIBCONN &nlc) if (crc != pFileURL->CRCsum) {
// crc check failed, try again
Netlib_LogfW(hNetlibUser,L"crc check failed for file %s",pFileURL->tszDiskPath);
- Netlib_FreeHttpRequest(pReply);
continue;
}
}
@@ -296,8 +295,6 @@ bool DownloadFile(FILEURL *pFileURL, HNETLIBCONN &nlc) ret = true;
}
else Netlib_LogfW(hNetlibUser,L"Downloading file %s failed with error %d",pFileURL->tszDownloadURL,pReply->resultCode);
-
- Netlib_FreeHttpRequest(pReply);
}
else {
Netlib_LogfW(hNetlibUser,L"Downloading file %s failed, host is propably temporary down.",pFileURL->tszDownloadURL);
|