Skip to content

Commit f5e97a1

Browse files
rubik-cube-manSupremeMortal
authored andcommitted
Always release buffer
1 parent ae064a0 commit f5e97a1

File tree

1 file changed

+2
-3
lines changed
  • common/src/main/java/org/cloudburstmc/protocol/common/util

1 file changed

+2
-3
lines changed

common/src/main/java/org/cloudburstmc/protocol/common/util/Zlib.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ public ByteBuf inflate(ByteBuf buffer, int maxSize) throws DataFormatException {
6666
throw new DataFormatException("Inflated data exceeds maximum size");
6767
}
6868
}
69+
decompressed.retain();
6970
return decompressed;
70-
} catch (DataFormatException e) {
71-
decompressed.release();
72-
throw e;
7371
} finally {
72+
decompressed.release();
7473
if (source != null && source != buffer) {
7574
source.release();
7675
}

0 commit comments

Comments
 (0)