From 5202a7ff7ff1787e3631d4b4a1e2763d0392a12e Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Mon, 2 Nov 2020 15:39:29 +0100 Subject: [PATCH] add --- cv5/a_train.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }