Unless you're creating a new node, you don't need to malloc() more memory. You can get rid of the call to malloc() in draw_balls().
This code:
Code:
Position* new_position = malloc(sizeof(Position));
new_position = *list;
allocates memory and immediately changes the pointer to that memory to point to a different place, losing your only reference to the memory you just allocated. This is referred to as a memory leak since there's no way to ever free the memory you allocated.
Code:
for(p = new_position; p !=NULL; p = p->next){
fillCircle4(new_position->row, new_position->col, 7, COLOR(0, 0, 0)); // the 7 denotes the size, and the
//COLOR, is a color, black, I just made all the balls, or wanted to
}
Here you have p walking through the list, but you're referencing new_position in your fillCircle4() call. In fact, the whole draw_balls() function can be written much simpler like this:
Code:
void draw_balls(Position **list)
{
Position *p;
for(p = *list;p != NULL;p = p->next)
fillCircle4(p->row, p->col, 7, COLOR(0, 0, 0));
}
Your main() and add_position() functions look good.