This commit is contained in:
Maryna Kravtsova 2020-11-03 21:31:24 +01:00
parent 2c6c2c9004
commit 6b862ba9d7

View File

@ -84,10 +84,12 @@ 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){
first = this->next;
free(this)
this->next = NULL; this->next = NULL;
//free(this->next); //free(this->next);
return this; return first;
} }
this = this->next; this = this->next;
} }