Commit a770d61d20677dbdfc49a94e5c9f80cf45c8bd83

Thomas de Grivel 2020-09-07T12:45:06

fix rule realloc

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/rule.c b/rule.c
index d73cd31..04bbad8 100644
--- a/rule.c
+++ b/rule.c
@@ -45,7 +45,7 @@ void rules_enlarge (s_rules *rr)
 {
   assert(rr);
   rr->size += rr->size < 1024 ? rr->size : 1024;
-  if (!(rr->rule = realloc(rr->rule, rr->size)))
+  if (!(rr->rule = realloc(rr->rule, rr->size * sizeof(s_rule))))
     err(10, "rules realloc");
   assert(rr->size > rr->count);
 }