ASAN is showing that the CollectionScanNode created by makeCollectionScan is getting leaked. There are a few paths that do not explicitly delete this object:
1) The MatchExpression shallowClone operation just after the CollectionScanNode creation can throw an exception.
2) At least one error path in QueryPlannerAnalysis::analyzeDataAccess() exits early without freeing the "solnRoot" QuerySolutionNode object.