#fixed code
                                public void zipResults(String dir) {

        try {
            File srcDir = new File(dir);
            FileOutputStream fout = new FileOutputStream(dir + ".tar.gz");
            GZIPOutputStream gzout = new GZIPOutputStream(fout);
            TarArchiveOutputStream taos = new TarArchiveOutputStream(gzout);
            taos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_STAR);
            taos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);

            //out.setLevel(ZipOutputStream.DEFLATED);
            archiveResults(taos, srcDir, "");
            taos.close();
            logger.debug("Archive " + dir + ".zip was created");
            FileUtils.deleteDirectory(srcDir);
            logger.debug("Temp directory " + dir + " was deleted.");

        } catch (Exception ioe) {
            logger.error("Couldn't create archive.\n", ioe);
            throw new RuntimeException(("Error creating compressed archive from statistics files."));
        }
    }
#vulnerable code 
                                public void zipResults(String dir) {

        try {
            File srcDir = new File(dir);
            ZipOutputStream out = new ZipOutputStream(new FileOutputStream(dir + ".zip"));
            out.setLevel(ZipOutputStream.DEFLATED);
            SystemUtils.zipDir("", srcDir, out);
            out.close();
            logger.debug("Archive " + dir + ".zip was created");
            FileUtils.deleteDirectory(srcDir);
            logger.debug("Temp directory " + dir + " was deleted.");

        } catch (Exception ioe) {
            logger.error("Couldn't create archive.\n", ioe);
            throw new RuntimeException(("Error creating compressed archive from statistics files." ));
        }
    } 
                            #location 13 
                            #vulnerability type RESOURCE_LEAK