Fix buffer leak in vanilla custom payload packet handling (#4512)

This commit is contained in:
Ben Staddon 2017-11-12 18:38:10 +00:00 committed by LexManos
parent ad202e2e83
commit baaa6c6505
2 changed files with 16 additions and 1 deletions

View File

@ -82,3 +82,11 @@
if (potion != null)
{
@@ -1856,6 +1867,7 @@
}
finally
{
+ if (false) // Forge: let packet handle releasing buffer
packetbuffer.release();
}
}

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java
+++ ../src-work/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java
@@ -46,7 +46,11 @@
@@ -46,12 +46,18 @@
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException
{
p_148840_1_.func_180714_a(this.field_149172_a);
@ -12,3 +12,10 @@
}
public void func_148833_a(INetHandlerPlayClient p_148833_1_)
{
p_148833_1_.func_147240_a(this);
+ // Forge: fix network buffer leaks (MC-121884)
+ if (this.field_149171_b != null) this.field_149171_b.release();
}
@SideOnly(Side.CLIENT)