#vulnerable code 
                                private void copyConnStreamToResponse(HttpURLConnection conn, HttpServletResponse resp) throws IOException {
        InputStream inStream = null;
        InputStreamReader reader = null;
        try {
            if (!resp.isCommitted()) {
                PrintWriter writer = resp.getWriter();
                inStream = getInputStream(conn);
                reader = new InputStreamReader(inStream);
                int len;
                char[] buffer = new char[1024];
                while ((len = reader.read(buffer)) != -1) {
                    writer.write(buffer, 0, len);
                }
            }
        } finally {
            quetlyClose(inStream, reader);
        }
    } 
                            #location 16 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private void copyConnStreamToResponse(HttpURLConnection conn, HttpServletResponse resp) throws IOException {
        if (resp.isCommitted()) {
            return;
        }

        InputStream inStream = null;
        OutputStream outStream = null;
        try {
            inStream = getInputStream(conn);
            outStream = resp.getOutputStream();
            byte[] buffer = new byte[1024];
            for (int len = -1; (len = inStream.read(buffer)) != -1; ) {
                outStream.write(buffer, 0, len);
            }
            outStream.flush();
        } finally {
            quetlyClose(inStream, outStream);
        }
    }