Commit d664ed09fd311bd928a19d5ca92b90ed1b6a4268

Thomas de Grivel 2024-06-27T11:55:36

make test_asan: fix two memory leaks in env_call_get and env_module_maybe_reload

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/libc3/env.c b/libc3/env.c
index ecc075b..80982a5 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -114,6 +114,7 @@ bool env_call_get (s_env *env, s_call *call)
       facts_cursor_clean(&cursor);
       return false;
     }
+    tag_clean(&tag_var);
   }
   facts_cursor_clean(&cursor);
   if (! facts_find_fact_by_tags(&env->facts, &tag_ident, &tag_is_a,
@@ -2230,6 +2231,7 @@ bool env_module_maybe_reload (s_env *env, const s_sym *module)
   if (compare_tag(&tag_load_time, &tag_mtime) < 0)
     r = env_module_load(env, module);
   tag_clean(&tag_mtime);
+  tag_clean(&tag_load_time);
   return r;
 }