diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 91be99f9615..59ccaa99c3d 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -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 data(nc->data(httpRequest.url())); if (!data || data->size() < it->second.toLongLong()) return false; // The data is smaller than the content-length specified }