diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java
index <HASH>..<HASH> 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java
@@ -677,7 +677,9 @@ public class Http2ConnectionHandler extends ByteToMessageDecoder implements Http
                 // Protect against re-entrancy. Could happen if writing the frame fails, and error handling
                 // treating this is a connection handler and doing a graceful shutdown...
                 if (lastStreamId == connection().remote().lastStreamKnownByPeer()) {
-                    return promise;
+                    // Release the data and notify the promise
+                    debugData.release();
+                    return promise.setSuccess();
                 }
                 if (lastStreamId > connection.remote().lastStreamKnownByPeer()) {
                     throw connectionError(PROTOCOL_ERROR, "Last stream identifier must not increase between " +
Correctly release debugData and notify the promise when goAway was already sent

Motivation:

Commit <I>f<I>c<I>bb<I>c<I>f<I>d<I>e also introduced a change to guard against re-entrance but failed to correctly handle the debugData and promise.

Modifications:

Release debugData and correctly notify the promise.

Result:

No more buffer leak and promise is always notified.