#vulnerable code 
                                protected File createEmptyArchive(String archivename) throws Exception {
        ArchiveOutputStream out = null;
        OutputStream stream = null;
        archiveList = new ArrayList();
        try {
            archive = File.createTempFile("empty", "." + archivename);
            stream = new FileOutputStream(archive);
            out = factory.createArchiveOutputStream(archivename, stream);
        } finally {
            if (out != null) {
                out.close();
            } else if (stream != null) {
                stream.close();
            }
        }
        return archive;
    } 
                            #location 11 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                protected File createEmptyArchive(String archivename) throws Exception {
        ArchiveOutputStream out = null;
        OutputStream stream = null;
        archiveList = new ArrayList();
        try {
            archive = File.createTempFile("empty", "." + archivename);
            stream = new FileOutputStream(archive);
            out = factory.createArchiveOutputStream(archivename, stream);
            out.finish();
        } finally {
            if (out != null) {
                out.close();
            } else if (stream != null) {
                stream.close();
            }
        }
        return archive;
    }