You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2020/12/29 14:04:56 UTC

[iotdb] branch master updated: Fix the input resource leak when deserializing device owner (#2374)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new c125df3  Fix the input resource leak when deserializing device owner (#2374)
c125df3 is described below

commit c125df329bb54ca3c819a066d1bcff60c1b9f273
Author: Benedict Jin <as...@apache.org>
AuthorDate: Tue Dec 29 22:04:42 2020 +0800

    Fix the input resource leak when deserializing device owner (#2374)
---
 .../org/apache/iotdb/db/sync/receiver/load/FileLoaderManager.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderManager.java b/server/src/main/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderManager.java
index 8160745..7a0c83b 100644
--- a/server/src/main/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderManager.java
@@ -138,8 +138,8 @@ public class FileLoaderManager {
 
   private void deSerializeDeviceOwnerMap(File deviceOwnerFile)
       throws IOException, ClassNotFoundException {
-    try (ObjectInputStream deviceOwnerInput = new ObjectInputStream(
-        new FileInputStream(deviceOwnerFile))) {
+    try (FileInputStream fis = new FileInputStream(deviceOwnerFile);
+         ObjectInputStream deviceOwnerInput = new ObjectInputStream(fis)) {
       deviceOwnerMap = (Map<String, String>) deviceOwnerInput.readObject();
     }
   }