Skip to content
Snippets Groups Projects
Commit cf485f23 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

p2p: fix another heap-use-after-free

Change-Id: I24d212f25d355535536a038ec13b92898ce9eb03
Gitlab: #307
parent 765e0650
No related branches found
No related tags found
No related merge requests found
...@@ -743,9 +743,11 @@ DhtPeerConnector::Impl::answerToRequest(PeerConnectionMsg&& request, ...@@ -743,9 +743,11 @@ DhtPeerConnector::Impl::answerToRequest(PeerConnectionMsg&& request,
std::move( std::move(
waitForReadyEndpoints_[idx])); waitForReadyEndpoints_[idx]));
connection->setOnStateChangedCb( connection->setOnStateChangedCb(
[this, peer_h](const DRing::DataTransferId& id, [w = weak(), peer_h](const DRing::DataTransferId& id,
const DRing::DataTransferEventCode& code) { const DRing::DataTransferEventCode& code) {
stateChanged(peer_h, id, code); if (auto sthis = w.lock()) {
sthis->stateChanged(peer_h, id, code);
}
}); });
connection->attachOutputStream(std::make_shared<FtpServer>(accountId, peer_h)); connection->attachOutputStream(std::make_shared<FtpServer>(accountId, peer_h));
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment