Skip to content

Commit 9c79e7f

Browse files
committed
In the case of an exception, clear the rented array.
1 parent 65b7a23 commit 9c79e7f

File tree

1 file changed

+1
-1
lines changed
  • projects/RabbitMQ.Client/client/impl

1 file changed

+1
-1
lines changed

projects/RabbitMQ.Client/client/impl/Frame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ internal static bool TryReadFrame(ref ReadOnlySequence<byte> buffer, uint maxMes
344344

345345
if (payloadBytes[payloadSize] != Constants.FrameEnd)
346346
{
347-
ArrayPool<byte>.Shared.Return(payloadBytes);
347+
ArrayPool<byte>.Shared.Return(array: payloadBytes, clearArray: true);
348348
throw new MalformedFrameException($"Bad frame end marker: {payloadBytes[payloadSize]}");
349349
}
350350

0 commit comments

Comments
 (0)