summaryrefslogtreecommitdiff
path: root/src/runner/runner.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-09 04:33:05 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-09 04:33:05 +0330
commit6a38b0247cff3be5ce2d0f725d559253357b4dc6 (patch)
tree1f305316cdc50fdb45c28eb0722effbb2491183f /src/runner/runner.c
parentde52585a1b2736a6a788ebc57000d7496f259e64 (diff)
fix leaks
fix printError
Diffstat (limited to 'src/runner/runner.c')
-rw-r--r--src/runner/runner.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runner/runner.c b/src/runner/runner.c
index 606fe89..dde5307 100644
--- a/src/runner/runner.c
+++ b/src/runner/runner.c
@@ -69,7 +69,9 @@ AstTree *runAstTreeFunction(AstTreeFunction *function, AstTree **arguments,
continue;
case AST_TREE_TOKEN_VARIABLE_DEFINE: {
AstTreeVariable *variable = expr.metadata;
- variable->value = calcAstTreeValue(variable->value);
+ AstTree *value = calcAstTreeValue(variable->value);
+ astTreeDelete(variable->value);
+ variable->value = value;
}
continue;
case AST_TREE_TOKEN_OPERATOR_SUM: