ipc: use deleteLater() in IpcServerConnection to prevent use-after-free

This commit is contained in:
Manuel Romei 2026-01-18 17:20:12 +01:00 committed by outfoxxed
parent 8fd0de4580
commit 191085a882
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -61,7 +61,7 @@ IpcServerConnection::IpcServerConnection(QLocalSocket* socket, IpcServer* server
void IpcServerConnection::onDisconnected() {
qCInfo(logIpc) << "IPC connection disconnected" << this;
delete this;
this->deleteLater();
}
void IpcServerConnection::onReadyRead() {
@ -88,7 +88,7 @@ void IpcServerConnection::onReadyRead() {
// async connections reparent
if (dynamic_cast<IpcServer*>(this->parent()) != nullptr) {
delete this;
this->deleteLater();
}
}