Understanding the deflection of coronal mass ejections (CMEs) is of great interest to the space weather community because of their implications for improving the prediction of CME. This paper aims to shed light into the effects of the coronal magnetic field environment on CME trajectories. We analyze the influence of the magnetic environment on the early development of a particular CME event. On 2011 January 24 an eruptive filament was ejected in association with a CME that suffered a large deflection from its source region and expected trajectory. We characterize the 3D evolution of the prominence material using the tie-pointing/triangulation reconstruction technique on EUV and white-light images. To estimate the coordinates in 3D space of the apex of the CME we use a forward-modeling technique that reproduces the large-scale structure of the flux rope-like CME, the Graduated Cylindrical Shell model. We found that the deflection amounts to 42 ° in latitude and 20 ° in longitude and that most of it occurs at altitudes below 4R⊙ . Moreover, we found a non-negligible deflection at higher altitudes. Combining images of different wavelengths with the extrapolated magnetic field obtained from a potential field source surface model we confirm the presence of two magnetic structures near the erupting event. The magnetic field environment suggests that field lines from the southern coronal hole act as a magnetic wall that produces the large latitudinal deflection; while a nearby pseudostreamer and a northward extension of the southern coronal hole may be responsible for the eastward deflection of the CME.