From 39d2ad7ee3cdb47b7ead29060e7042aeda269510 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 11 Dec 2021 17:42:23 +0000 Subject: [PATCH] Fix ByteBuf leak Signed-off-by: Graham --- .../kotlin/org/openrs2/archive/cache/CacheImporter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt index 04127af7..750b881a 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt @@ -102,11 +102,11 @@ public class CacheImporter @Inject constructor( // import master index val masterIndex = createMasterIndex(store) - if (masterIndex.index.entries.isEmpty()) { - throw IOException("Master index empty, cache probably corrupt") - } - val masterIndexId = try { + if (masterIndex.index.entries.isEmpty()) { + throw IOException("Master index empty, cache probably corrupt") + } + addMasterIndex(connection, masterIndex) } finally { masterIndex.release()