This commit is contained in:
Maryna Kravtsova 2020-11-03 21:24:35 +01:00
parent 81c09c06b7
commit f6cc965af6

View File

@ -84,7 +84,7 @@ struct car* clear_train(struct car* first, const char* target) {
while(this != NULL){ while(this != NULL){
int x = strcmp(this->value, target); int x = strcmp(this->value, target);
if(x == 0){ if(x == 0){
free(this); free(this->next);
return first; return first;
} }
this = this->next; this = this->next;