To study the build up of a magnetic flux rope before a major flare and coronal mass ejection ( CME ) , we compute the magnetic helicity injection , twist accumulation , and the topology structure of the three dimensional magnetic field , which is derived by the nonlinear force-free field model . The Extreme-ultraviolet Imaging Telescope on board the Solar and Heliospheric Observatory observed a series of confined flares without any CME before a major flare with a CME at 23:02 UT on 2005 January 15 in active region NOAA 10720 . We derive the vector velocity at eight time points from 18:27 UT to 22:20 UT with the differential affine velocity estimator for vector magnetic fields , which were observed by the Digital Vector Magnetograph at Big Bear Solar Observatory . The injected magnetic helicity is computed with the vector magnetic and velocity fields . The helicity injection rate was ( -16.47 \pm 3.52 ) \times 10 ^ { 40 } ~ { } \mathrm { Mx } ^ { 2 } ~ { } \mathrm { hr } ^ { -1 } . We find that only about 1.8 % of the injected magnetic helicity became finally the internal helicity of the magnetic flux rope , whose twist increasing rate was -0.18 \pm 0.08 Turns hr ^ { -1 } . The quasi-separatrix layers ( QSLs ) of the three dimensional magnetic field are computed by evaluating the squashing degree , Q . We find that the flux rope was wrapped by QSLs with large Q values , where the magnetic reconnection induced by the continuously injected magnetic helicity further produced the confined flares . We suggest that the flux rope was built up and heated by the magnetic reconnection in the QSLs .