http: fix leakage of network cache qiodevice
The QIODevice is owned by the caller of data(), so we should have freed it. Amends a6776de0c70d23ac197682c7bef603450cb8b03f Fixes: QTBUG-117787 Pick-to: 6.5 6.2 Change-Id: Ic5575649038480f52cc13ee229980ee1c7cee728 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mate Barany <mate.barany@qt.io> (cherry picked from commit 23996976cfe79e5f9845a09e26c177d14470c897) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
8e7dcd2256
commit
47c2aad025
@ -505,7 +505,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h
|
||||
|
||||
it = cacheHeaders.findRawHeader("content-length");
|
||||
if (it != cacheHeaders.rawHeaders.constEnd()) {
|
||||
QIODevice *data = nc->data(httpRequest.url());
|
||||
std::unique_ptr<QIODevice> data(nc->data(httpRequest.url()));
|
||||
if (!data || data->size() < it->second.toLongLong())
|
||||
return false; // The data is smaller than the content-length specified
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user