diff --git a/a_station.c b/a_station.c index 661a4d7..931980f 100644 --- a/a_station.c +++ b/a_station.c @@ -10,6 +10,16 @@ struct station* create_station(){ } void destroy_station(struct station* station){ + for (int i = 0 ; i< station->capacity; i++){ + struct car* start = station->tracks[i]; + struct car* this = start; + while(this != NULL){ + next = this->next; + free(this); + this=next; + } + free(station->tracks[i]); + } } int select_track(struct station* station, const char* target){