try fixing memory leak in path builder (#1442)

pull/1446/head
Jeff 4 years ago committed by GitHub
parent ff02e62a79
commit 8be7c46531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -136,13 +136,14 @@ namespace llarp
if (status == SendStatus::Success)
{
ctx->router->pathContext().AddOwnPath(ctx->pathset, ctx->path);
ctx->pathset->PathBuildStarted(ctx->path);
ctx->pathset->PathBuildStarted(std::move(ctx->path));
}
else
{
LogError(ctx->pathset->Name(), " failed to send LRCM to ", ctx->path->Upstream());
ctx->pathset->HandlePathBuildFailed(ctx->path);
ctx->pathset->HandlePathBuildFailed(std::move(ctx->path));
}
ctx->pathset = nullptr;
};
if (ctx->router->SendToOrQueue(remote, msg, sentHandler))
{
@ -150,7 +151,10 @@ namespace llarp
ctx->router->PersistSessionUntil(remote, ctx->path->ExpireTime());
}
else
{
LogError(ctx->pathset->Name(), " failed to queue LRCM to ", remote);
sentHandler(SendStatus::NoLink);
}
}
}

Loading…
Cancel
Save