From 979dc3e3e4b3f95d51b5e5c471f2f1ab4648a8b6 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 13 May 2016 18:38:37 +0200 Subject: [PATCH] Fix one more possible leak as a follow up of 341a235fea2f11e368038a832453cec72246dca2 --- .../codec/http2/Http2ServerDowngraderTest.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ServerDowngraderTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ServerDowngraderTest.java index 3a7c3db16e..3d3cf0127a 100644 --- a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ServerDowngraderTest.java +++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ServerDowngraderTest.java @@ -346,12 +346,18 @@ public class Http2ServerDowngraderTest { Http2ResetFrame reset = new DefaultHttp2ResetFrame(0); Http2GoAwayFrame goaway = new DefaultHttp2GoAwayFrame(0); assertTrue(ch.writeInbound(reset)); - assertTrue(ch.writeInbound(goaway)); + assertTrue(ch.writeInbound(goaway.retain())); assertEquals(reset, ch.readInbound()); - assertEquals(goaway, ch.readInbound()); - assertThat(ch.readInbound(), is(nullValue())); - assertFalse(ch.finish()); + Http2GoAwayFrame frame = ch.readInbound(); + try { + assertEquals(goaway, frame); + assertThat(ch.readInbound(), is(nullValue())); + assertFalse(ch.finish()); + } finally { + goaway.release(); + frame.release(); + } } }