Skip to content

Commit aa83dc8

Browse files
authored
Make sure rented array is always returned (#49042)
1 parent 07b185d commit aa83dc8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Http/Http.Extensions/src/RequestDelegateFactory.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,10 +2006,12 @@ private static Expression BindComplexParameterFromFormItem(
20062006

20072007
return Expression.Block(
20082008
new[] { formArgument, formReader, formDict, formBuffer, formMaxKeyLength },
2009-
processFormExpr,
2010-
initializeReaderExpr,
2011-
Expression.Assign(formArgument, invokeMapMethodExpr),
2012-
returnBufferExpr,
2009+
Expression.TryFinally(
2010+
Expression.Block(
2011+
processFormExpr,
2012+
initializeReaderExpr,
2013+
Expression.Assign(formArgument, invokeMapMethodExpr)),
2014+
returnBufferExpr),
20132015
formArgument
20142016
);
20152017
}

0 commit comments

Comments
 (0)