diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2020-09-11 14:36:29 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-14 17:34:41 +0000 |
commit | b80b53bde9cfd36fbf2d50e129d123ba8f35df48 (patch) | |
tree | 199529bf284302ed3ee4d96b7222a12109f2e45c /src/mongo/db/pipeline/document_source_union_with.cpp | |
parent | ec929e17993ade6e0258aab73fd8024d1cb6180f (diff) | |
download | mongo-b80b53bde9cfd36fbf2d50e129d123ba8f35df48.tar.gz |
SERVER-50895 Fix leak of $unionWith cached pipeline for explain when execution does not read from sub-pipeline
Diffstat (limited to 'src/mongo/db/pipeline/document_source_union_with.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_union_with.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_union_with.cpp b/src/mongo/db/pipeline/document_source_union_with.cpp index 294b16accc3..3191468d65b 100644 --- a/src/mongo/db/pipeline/document_source_union_with.cpp +++ b/src/mongo/db/pipeline/document_source_union_with.cpp @@ -267,7 +267,7 @@ Value DocumentSourceUnionWith::serialize(boost::optional<ExplainOptions::Verbosi // We've either exhausted the sub-pipeline or at least started iterating it. Use the // cached pipeline to get the explain output since the '_pipeline' may have been // modified for any optimizations or pushdowns into the initial $cursor stage. - pipeCopy = _cachedPipeline; + pipeCopy = Pipeline::create(_cachedPipeline, _pipeline->getContext()).release(); } else { // The plan does not require reading from the sub-pipeline, so just include the // serialization in the explain output. |