You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2025/05/09 19:01:28 UTC
(pulsar) 08/15: [fix][misc] Fix ByteBuf leak in SchemaUtils (#24274)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit c2c0c788518c54cbe66cf3e73eddda18695b14bb
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Thu May 8 13:41:44 2025 +0300
[fix][misc] Fix ByteBuf leak in SchemaUtils (#24274)
(cherry picked from commit 8ecf0d6aec7c49e768db1927ab5088df780aa60f)
---
.../src/main/java/org/apache/pulsar/client/impl/schema/SchemaUtils.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/pulsar-common/src/main/java/org/apache/pulsar/client/impl/schema/SchemaUtils.java b/pulsar-common/src/main/java/org/apache/pulsar/client/impl/schema/SchemaUtils.java
index 2ed08af0681..dcc73d1d21f 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/client/impl/schema/SchemaUtils.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/client/impl/schema/SchemaUtils.java
@@ -370,6 +370,7 @@ public final class SchemaUtils {
ByteBuf byteBuf = PulsarByteBufAllocator.DEFAULT.heapBuffer(dataLength);
byteBuf.writeInt(keyBytes.length).writeBytes(keyBytes).writeInt(valueBytes.length).writeBytes(valueBytes);
byteBuf.readBytes(schema);
+ byteBuf.release();
return schema;
}