Commit 143b13f16cf4fa5f2bb8112466393c6e5e177247

Thomas de Grivel 2023-08-09T16:08:17

test_asan

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/libc3/module.c b/libc3/module.c
index ddbf71b..b94ff1b 100644
--- a/libc3/module.c
+++ b/libc3/module.c
@@ -39,8 +39,10 @@ s_tag * module_get (const s_module *module, const s_sym *sym,
   facts_with(module->facts, &cursor, (t_facts_spec) {
       &tag_name, &tag_is_a, &tag_module,
       &tag_symbol, &tag_ident, NULL, NULL});
-  if (! facts_with_cursor_next(&cursor))
+  if (! facts_with_cursor_next(&cursor)) {
+    facts_with_cursor_clean(&cursor);
     return NULL;
+  }
   facts_with_cursor_clean(&cursor);
   tag_init_1(&tag_cfn, ":cfn");
   tag_init_1(&tag_fn, ":fn");