Commit 3ecb4fd892738ba9b7fff843eb253d0fab3fa69b

Thomas de Grivel 2024-08-18T20:20:12

fix struct size

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/libkc3/env.c b/libkc3/env.c
index d4b5a29..91a79de 100644
--- a/libkc3/env.c
+++ b/libkc3/env.c
@@ -2066,8 +2066,9 @@ s_tag * env_facts_with_tags (s_env *env, s_facts *facts, s_tag *subject,
   s_tag tmp = {0};
   if (! (arguments = list_new_struct(&g_sym_FactW, NULL)))
     return NULL;
-  if (! struct_allocate(&arguments->tag.data.struct_))
+  if (! (arguments->tag.data.struct_.data = alloc(sizeof(s_fact_w))))
     return NULL;
+  arguments->tag.data.struct_.free_data = true;
   fact_w = arguments->tag.data.struct_.data;
   if (! facts_with_tags(facts, &cursor, subject, predicate, object))
     return NULL;