commit fc26fdf0f0f0530dde74c2a5c4cf6db174ecfec9
parent 289de06edf7f00dfb0bcaf14136ef4c61505fa6c
Author: NunoSempere <nuno.sempere@protonmail.com>
Date: Mon, 1 May 2023 19:57:11 -0400
remove small memory leak.
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/mumble b/mumble
Binary files differ.
diff --git a/src/mumble.c b/src/mumble.c
@@ -223,11 +223,12 @@ lispval* pop_lispval(lispval* v, int i)
return r;
}
-lispval* take_lispval(lispval* v, int i){
+lispval* take_lispval(lispval* v, int i){ // Unneeded.
lispval* x = pop_lispval(v, i);
delete_lispval(v);
return x;
}
+
lispval* builtin_op(char* op, lispval* v){
// For now, ensure all args are numbers
for(int i=0; i<v->count; i++){
@@ -291,6 +292,7 @@ lispval* evaluate_lispval(lispval* l)
if(l->count >=2 && ( (l->cell[0])->type == LISPVAL_SYM)){
lispval* op = pop_lispval(l, 0);
lispval* result = builtin_op(op->sym, l);
+ delete_lispval(op);
return result;
}
return l;