commit | d64ea7bede734500ec7bb962d6b337daa8cf383e | [log] [tgz] |
---|---|---|
author | 柯志勇10068695 <ke.zhiyong@zte.com.cn> | Fri Oct 19 14:54:52 2018 +0800 |
committer | Ray Milkey <ray@opennetworking.org> | Fri Oct 19 14:21:37 2018 +0000 |
tree | 65b6c6dcd97fbfa1b4075c773cedf65639b8c5a8 | |
parent | 55f80b6a232df2cd673b82c9d5c42b013aa07876 [diff] |
InputStream should be closed, or there will be a risk of memory leaks. Change-Id: I5b3a618bdeef21e5f4ff4eeae33bc7fcb15f28e7
diff --git a/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java b/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java index 13cc403..c0b3beb 100644 --- a/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java +++ b/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java
@@ -560,7 +560,9 @@ // assume that we can always fallback to default icon iconStream = ApplicationArchive.class.getResourceAsStream("/" + APP_PNG); } - return ByteStreams.toByteArray(iconStream); + byte[] icon = ByteStreams.toByteArray(iconStream); + iconStream.close(); + return icon; } catch (IOException e) { log.warn("Unable to read app icon for app {}", appName, e); }