QHttpSocketEngine: Fix memory leak

The reply needs to be parented or it's not guaranteed to be deleted

Change-Id: I7cbc31682f80dbbd9fb240fff9e6781cb6ca7b36
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d8077a0973f362376b69564a730c74e5c9366f8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2021-06-09 10:41:51 +02:00 committed by Qt Cherry-pick Bot
parent 8f3dca4555
commit 93450a6ab2

View File

@ -642,7 +642,7 @@ void QHttpSocketEngine::slotSocketReadNotification()
d->socket->readAll(); d->socket->readAll();
//We're done with the reply and need to reset it for the next connection //We're done with the reply and need to reset it for the next connection
delete d->reply; delete d->reply;
d->reply = new QHttpNetworkReply; d->reply = new QHttpNetworkReply(QUrl(), this);
} }
if (priv->phase == QAuthenticatorPrivate::Done) if (priv->phase == QAuthenticatorPrivate::Done)