#fixed code
                                public String readString(int length) throws IOException {
        byte[] responseBuffer = new byte[length];
        dataInput.readFully(responseBuffer);
        return new String(responseBuffer, StandardCharsets.UTF_8);
    }
#vulnerable code 
                                public String readString(int length) throws IOException {
        DataInput reader = new DataInputStream(inputStream);
        byte[] responseBuffer = new byte[length];
        reader.readFully(responseBuffer);
        return new String(responseBuffer, StandardCharsets.UTF_8);
    } 
                            #location 4 
                            #vulnerability type RESOURCE_LEAK