Commit 5a0444391790bc92263a3185d3c822047c785409

Thomas de Grivel 2023-09-19T22:42:39

wip asan

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/libc3/env.c b/libc3/env.c
index f674fa0..9ae581f 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -155,11 +155,15 @@ bool env_eval_array_cast (s_env *env, s_array *tmp, const s_tag *tag,
   assert(size);
   if (! call_init_cast(&call, tmp->type, tag))
     return false;
-  if (! env_eval_call(env, &call, &tag_eval))
+  if (! env_eval_call(env, &call, &tag_eval)) {
+    call_clean(&call);
     return false;
+  }
   tag_type = array_type_to_tag_type(tmp->type);
   data_eval = tag_to_pointer(&tag_eval, tag_type);
   memcpy(data, data_eval, size);
+  call_clean(&call);
+  tag_clean(&tag_eval);
   return true;
 }