GeezerVison is showing github.com — SslHandler: Fix possible buffer leak when an OOME is thrown during al… · netty/netty@64ac5ab
File tree
Expand file treeCollapse file tree
Open diff view settings
handler/src/main/java/io/netty/handler/ssl
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/SslHandler.java +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -885,10 +885,10 @@ private void wrap(ChannelHandlerContext ctx, boolean inUnwrap) throws SSLExcepti |
885 | 885 | } |
886 | 886 | result = wrap(alloc, engine, buf, out); |
887 | 887 | } |
888 | | - } catch (SSLException e) { |
889 | | - // Either wrapMultiple(...) or wrap(...) did throw. In this case we need to release the buffer |
890 | | - // that we removed from pendingUnencryptedWrites before failing the promise and rethrowing it. |
891 | | - // Failing to do so would result in a buffer leak. |
| 888 | + } catch (Throwable e) { |
| 889 | + // Either wrapMultiple(...), wrap(...) or allocateOutNetBuf(...) did throw. |
| 890 | + // In this case we need to release the buffer that we removed from pendingUnencryptedWrites |
| 891 | + // before failing the promise and rethrowing it. Failing to do so would result in a buffer leak. |
892 | 892 | // See https://github.com/netty/netty/issues/14644 |
893 | 893 | // |
894 | 894 | // We don't need to release out here as this is done in a finally block already. |
|