Commit d9cba6adce83b9effe3a7e69e60d85324ce9ccc1

Thomas de Grivel 2023-03-18T08:26:27

plug memleak

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index d7f21a7..c18c60a 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -257,8 +257,10 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, u8 min_precedence)
                       next_op_precedence == op_precedence))) {
       call_init_op(&tmp2);
       tmp2.arguments->tag = *right;
-      if ((r = buf_parse_call_op_rec(buf, &tmp2, (next_op_precedence > op_precedence) ? op_precedence + 1 : op_precedence)) <= 0)
+      if ((r = buf_parse_call_op_rec(buf, &tmp2, (next_op_precedence > op_precedence) ? op_precedence + 1 : op_precedence)) <= 0) {
+        call_clean(&tmp2);
         break;
+      }
       bzero(right, sizeof(s_tag));
       right->type.type = TAG_CALL;
       right->data.call = tmp2;