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 b279c52101
commit d35b88c1b2

View file

@ -252,7 +252,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.