mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-18 13:49:59 +01:00
runFile: Free file source before exiting the function (#774)
This prevents a memleak, noticeable when running `wren_test` under `valgrind`. For example, the following command would leak `./bin/wren_test_d any_example.wren`
This commit is contained in:
@ -441,6 +441,7 @@
|
|||||||
WrenInterpretResult result = wrenInterpret(vm, module->chars, source);
|
WrenInterpretResult result = wrenInterpret(vm, module->chars, source);
|
||||||
|
|
||||||
pathFree(module);
|
pathFree(module);
|
||||||
|
free(source);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user