Fix use after free in LanLinkProvider::connectError()

If QSslSocket::connectToHost() hasn't finished running.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
This commit is contained in:
Matthias Gerstner 2020-09-24 17:03:06 +02:00 committed by Albert Vaca Cintora
parent aa84aa5dcb
commit 7e47d04053

View file

@ -270,7 +270,7 @@ void LanLinkProvider::connectError(QAbstractSocket::SocketError socketError)
//The socket we created didn't work, and we didn't manage
//to create a LanDeviceLink from it, deleting everything.
delete m_receivedIdentityPackets.take(socket).np;
delete socket;
socket->deleteLater();
}
//We received a UDP packet and answered by connecting to them by TCP. This gets called on a successful connection.