From 1a6f102f5d06c9cfc2526f2525ee4f69dfce8072 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Thu, 21 Jan 2021 08:59:09 +1100 Subject: [PATCH] Prevent double free on exception Fixes #9194 --- .../resteasy/runtime/standalone/VertxOutputStream.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/extensions/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxOutputStream.java b/extensions/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxOutputStream.java index ea3e339db0d7b..3dd4255d70d08 100644 --- a/extensions/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxOutputStream.java +++ b/extensions/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxOutputStream.java @@ -142,11 +142,7 @@ private CompletionStage asyncFlush(boolean isLast) { if (pooledBuffer != null) { ByteBuf sentBuffer = pooledBuffer; pooledBuffer = null; - CompletionStage ret = response.writeNonBlocking(sentBuffer, isLast); - return ret.whenComplete((v, t) -> { - if (t != null) - sentBuffer.release(); - }); + return response.writeNonBlocking(sentBuffer, isLast); } return CompletableFuture.completedFuture(null); }