#fixed code
                                public void commitAndRelease(boolean modifiesInedges, boolean modifiesOutedges) throws IOException {
        byte[] data = dataBlockManager.getRawBlock(blockId);

        if (modifiesInedges) {
            FileOutputStream fos = new FileOutputStream(new File(edgeDataFilename));
            fos.write(data);
            fos.flush();
            fos.close();
        } else if (modifiesOutedges) {
            ucar.unidata.io.RandomAccessFile rFile =
                    new ucar.unidata.io.RandomAccessFile(edgeDataFilename, "rwd");
            rFile.seek(rangeStartEdgePtr);
            int last = streamingOffsetEdgePtr;
            if (last == 0) last = edataFilesize;
            
            rFile.write(data, rangeStartEdgePtr, last  - rangeStartEdgePtr);
            rFile.flush();
            rFile.close();
        }
        dataBlockManager.release(blockId);

    }
#vulnerable code 
                                public void commitAndRelease(boolean modifiesInedges, boolean modifiesOutedges) throws IOException {
        byte[] data = dataBlockManager.getRawBlock(blockId);

        if (modifiesInedges) {
            FileOutputStream fos = new FileOutputStream(new File(edgeDataFilename));
            fos.write(data);
            fos.close();
        } else if (modifiesOutedges) {
            ucar.unidata.io.RandomAccessFile rFile =
                    new ucar.unidata.io.RandomAccessFile(edgeDataFilename, "rwd");
            rFile.seek(rangeStartEdgePtr);
            int last = streamingOffsetEdgePtr;
            if (last == 0) last = edataFilesize;
            rFile.write(data, rangeStartEdgePtr, last  - rangeStartEdgePtr);
            rFile.close();
        }
        dataBlockManager.release(blockId);

    } 
                            #location 16 
                            #vulnerability type RESOURCE_LEAK