#fixed code
                                private String convert(HttpEntity entity) {
        try {
            if (entity.isStreaming()) {
                return entity.toString();
            }
            InputStreamReader is = new InputStreamReader(entity.getContent(),"UTF-8");
            StringBuilder sb = new StringBuilder();
            try (BufferedReader br = new BufferedReader(is)) {
                String read = br.readLine();

                while (read != null) {
                    //System.out.println(read);
                    sb.append(read);
                    read = br.readLine();
                }
                return sb.toString();
            }
        } catch (IOException e) {
            return "[error serializing inputstream for debugging]";
        }
    }
#vulnerable code 
                                private String convert(HttpEntity entity) {
        try {
            if (entity.isStreaming()) {
                return entity.toString();
            }
            InputStreamReader is = new InputStreamReader(entity.getContent());
            StringBuilder sb = new StringBuilder();
            BufferedReader br = new BufferedReader(is);
            String read = br.readLine();

            while (read != null) {
                //System.out.println(read);
                sb.append(read);
                read = br.readLine();
            }
            return sb.toString();
        } catch (IOException e) {
            return "[error serializing inputstream for debugging]";
        }
    } 
                            #location 17 
                            #vulnerability type RESOURCE_LEAK