#vulnerable code 
                                private static void storeJar(File target, String entryName, Properties props) throws IOException {
        byte[] bytes = toBytes(props);
        InputStream input = new ByteArrayInputStream(bytes);
        JarOutputStream output = new JarOutputStream(new FileOutputStream(target));
        try {
            ZipEntry entry = new ZipEntry(entryName);
            output.putNextEntry(entry);
            byte[] buffer = new byte[4096];
            int size;
            while ((size = input.read(buffer)) != -1)
                output.write(buffer, 0, size);
        } finally {
            input.close();
            output.close();
        }
    } 
                            #location 4 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private static void storeJar(File target, String entryName, Properties props) throws IOException {
        byte[] bytes = toBytes(props);
        InputStream input = new ByteArrayInputStream(bytes);
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(target);
            try {
                JarOutputStream output = new JarOutputStream(fileOutputStream);
                try {
                    ZipEntry entry = new ZipEntry(entryName);
                    output.putNextEntry(entry);
                    byte[] buffer = new byte[4096];
                    int size;
                    while ((size = input.read(buffer)) != -1)
                        output.write(buffer, 0, size);
                } finally {
                    output.close();
                }
            } finally {
                fileOutputStream.close();
            }
        } finally {
            input.close();
        }
    }