Commit cf485f23 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud

p2p: fix another heap-use-after-free

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