fixed memory leak

This commit is contained in:
Francesco Cozzuto
2021-12-01 14:08:11 +01:00
parent 3238c2fb8e
commit a7cdb0943d
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -19,4 +19,4 @@ fun append_esclamation_mark(A, n)
return A;
}
print(append_esclamation_mark(D, 7), '\n');
print(append_esclamation_mark(D, 3), '\n');
+3
View File
@@ -1,3 +1,6 @@
// NOTE: This data structure doesn't strictly depend on
// the runtime, so it could be moved to src/objects.
#include "../utils/defs.h"
#include "../objects/objects.h"
+4 -1
View File
@@ -73,7 +73,10 @@ static Object *call(Object *self, Object **argv, unsigned int argc, Heap *heap,
argv2[i] = Object_NewNone(heap, error);
if(argv2[i] == NULL)
return 0;
{
free(argv2);
return NULL;
}
}
}
else UNREACHABLE;