You need to move directly towards your target, but unlike in 3.5, I'd say you can avoid obstacles on the way. It doesn't specify a straight line, just the shortest route. You must stop in the first square you can make a melee attack from. That could be interesting if you have a reach weapon.