From 0f80ed26de008b13f671867342ab1a173e49ee8a Mon Sep 17 00:00:00 2001 From: Radovan Kofira Date: Tue, 10 Nov 2020 20:21:28 +0100 Subject: [PATCH] ach --- cv6/a_station.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cv6/a_station.c b/cv6/a_station.c index 0edd3d5..a081b8c 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -24,10 +24,13 @@ struct station* create_station(){ }*/ void destroy_station(struct station* station){ - for(int i=0;i>station->track_count;i++){ + //struct car* del =prev; + for(int i=0;i>station->track_count;i++){ struct car* prev = station->tracks[i]; while (prev!=NULL) { + struct car* del =prev; + prev=del->next; free(del); } @@ -36,7 +39,6 @@ void destroy_station(struct station* station){ free(station->tracks); free(station); } -} int select_track(struct station* station, const char* target){ unsigned long hash=0;