Skip to content

Commit 663f290

Browse files
authored
Correct file descriptor leak for zip (#81)
1 parent 50350ec commit 663f290

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/AddPatchEntry.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,6 @@ public CommandResponse call() throws Exception {
6060
return new CommandResponse(-1, msg);
6161
}
6262

63-
/**
64-
* Validate local patch file's digest against the digest stored in ARU.
65-
*
66-
* @param patchNumber the ARU patch number without the 'p'
67-
* @param password the password to be used for the ARU query (Oracle Support credential)
68-
* @return true if the local file digest matches the digest stored in Oracle ARU
69-
* @throws Exception if the ARU call to get patch details failed
70-
*/
71-
private CommandResponse validateAndAddToCache(String patchNumber, String password) throws Exception {
72-
return addToCache(patchNumber);
73-
}
74-
7563
/**
7664
* Add patch to the cache.
7765
*

imagetool/src/main/java/com/oracle/weblogic/imagetool/util/Utils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,7 @@ public static String getCacheDir() throws IOException {
640640

641641
public static String getOpatchVersionFromZip(String fileName) {
642642

643-
try {
644-
ZipFile zipFile = new ZipFile(fileName);
643+
try (ZipFile zipFile = new ZipFile(fileName)) {
645644

646645
Enumeration<? extends ZipEntry> entries = zipFile.entries();
647646

0 commit comments

Comments
 (0)