diff --git a/cv5/a_train.c b/cv5/a_train.c index 6bb2933..bffcdd8 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -6,10 +6,12 @@ #include "a_train.h" struct car* add_car(struct car* first,const char* target) { + struct car* newcar = calloc(1, sizeof(struct car)); + if(target == NULL){ return 0; } - struct car* newcar = calloc(1, sizeof(struct car)); + if(first == NULL){ return newcar; }