aboutsummaryrefslogtreecommitdiff
path: root/src/runner/runner.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-15 01:37:42 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-15 01:47:13 +0330
commit512453533f52c9a318011768297d9ecfdbc02a59 (patch)
treecb7a8b28540358bcacd1de0acfe512ede1ca6256 /src/runner/runner.c
parentb6a27a2fcc02641801b4193d0f068608e18dbcbd (diff)
fix double free and memory leaks
Diffstat (limited to 'src/runner/runner.c')
-rw-r--r--src/runner/runner.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runner/runner.c b/src/runner/runner.c
index 3ddeb85..f144693 100644
--- a/src/runner/runner.c
+++ b/src/runner/runner.c
@@ -1575,7 +1575,8 @@ AstTree *runExpression(AstTree *expr, AstTreeScope *scope, bool *shouldRet,
AstTreeFunction *function =
shapeShifter->generateds.functions[metadata->index];
- return newAstTree(AST_TREE_TOKEN_FUNCTION, function,
+ return newAstTree(AST_TREE_TOKEN_FUNCTION,
+ copyAstTreeFunction(function, NULL, NULL, 0, false),
copyAstTree(expr->type), expr->str_begin, expr->str_end);
}
case AST_TREE_TOKEN_NONE: