This commit is contained in:
Maryna Kravtsova 2020-11-02 15:15:09 +01:00
parent 79d7a7636d
commit 33dc166873

View File

@ -8,7 +8,7 @@
struct car* add_car(struct car* first,const char* target) {
struct car* newcar = calloc(1, sizeof(struct car));
if(target == NULL){
return;
exit(0);
}
strcpy(newcar->value, target);
@ -47,11 +47,11 @@ void cancel_train(struct car* first) {
cancel_train(first->next);
first->next = NULL;
}
//else if(first->next == NULL){
//free(first);
if(first->next == NULL){
free(first);
// cancel_train(first->next);
// }
free(first);
}
//free(first);
}