Replace width and height constraints with trailing and bottom constraints, so it works properly regardless of orientation
Fix leaks: Replace malloc with a dynamic array (or if you keep malloc, make sure to free); Also CFPathRelease the paths you create with CGPathCreateMutable()
CLLocationManager should be private variable
Random corrections: Remove CLLocationManager as it's not relevant to this demo; make sure to initialize a few variables (only objects are assured to be initialized; add check for numberOfCoordinates; remove redundant coordinates array; add missing return in viewForOverlay; a few minor typographical edits