From b701fb7fdcf5b19750ab030d473fcc394f97e154 Mon Sep 17 00:00:00 2001 From: Kozar Date: Tue, 12 Nov 2024 12:47:48 +0000 Subject: [PATCH] Initializacia --- cv7/program.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cv7/program.c b/cv7/program.c index 266a371..5b330c1 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -32,10 +32,16 @@ struct tree* load_tree() { if (node->value[0] != '*') { node->left = load_tree(); node->right = load_tree(); + + if (!node->left || !node->right) { + destroy_tree(node); + return NULL; + } } return node; } + void run_tree(struct tree* tree) { if (!tree) { return;