#fixed code
                                @Override
    protected void  finishOutput() throws IOException {
    }
#vulnerable code 
                                @Override
    protected void  finishOutput() throws IOException {
        try {
            this.out.flush();
        } catch (IOException e) {
            log.error("flush failed");
            throw e;
        }

            // Read and log the response from the server for diagnostic purposes.

        InputStreamReader socketInputStream = new InputStreamReader(socket.getInputStream());
        BufferedReader bufferedSocketInputStream = new BufferedReader(socketInputStream);
        String line;
        while (socketInputStream.ready() && (line = bufferedSocketInputStream.readLine()) != null) {
            log.warn("OpenTSDB says: " + line); 
        }
    } 
                            #location 8 
                            #vulnerability type RESOURCE_LEAK