diff --git a/du6/a_station.c b/du6/a_station.c index 8f659d6..fd2579b 100644 --- a/du6/a_station.c +++ b/du6/a_station.c @@ -10,6 +10,17 @@ struct station* create_station(){ } void destroy_station(struct station* station){ + + for (int i = 0; i < station -> track_count; i++){ + struct car* temp = station -> tracks[i]; + while (temp != NULL) { + struct car* temp2 = temp; + temp = temp -> next; + free (temp2); + } + } + free(station); + } int select_track(struct station* station, const char* target){