Actually, there are 2 problems.

1. When you allocated n+1 Coord objects, you are using the extra 1 for the header. It is very difficult to understand your code and this should be separated into a different function to avoid the confusion.
2. Using memory after free(), is undefined behavior. In other words, it may work or crash anytime.