Skip to content

Commit 829dac6

Browse files
authored
Merge pull request #135 from Cysharp/feature/FixMemoryLeakOnError
Release a string when a request results in an error
2 parents 58a5b75 + f0caaa7 commit 829dac6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ private static unsafe void OnComplete(int reqSeq, IntPtr state, CompletionReason
592592
{
593593
requestContext.CompleteAsFailed(UnsafeUtilities.GetStringFromUtf8Bytes(buf->AsSpan()), h2ErrorCode);
594594
}
595-
catch
595+
finally
596596
{
597597
NativeMethods.yaha_free_byte_buffer(buf);
598598
}

0 commit comments

Comments
 (0)