diff options
| author | Baitinq <[email protected]> | 2025-07-26 19:32:57 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-07-26 19:32:57 +0200 |
| commit | c201bc78676c61abc10c24b4bb5ea8ee8ec23a1e (patch) | |
| tree | 75e469fc9082e9b7ab06402bdb244dae49dc13c5 /src | |
| parent | Misc: Cleanup readme (diff) | |
| download | pry-lang-c201bc78676c61abc10c24b4bb5ea8ee8ec23a1e.tar.gz pry-lang-c201bc78676c61abc10c24b4bb5ea8ee8ec23a1e.tar.bz2 pry-lang-c201bc78676c61abc10c24b4bb5ea8ee8ec23a1e.zip | |
Parser: Fix memory leak
Diffstat (limited to 'src')
| -rw-r--r-- | src/parser.pry | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parser.pry b/src/parser.pry index 54538b2..4d6b27a 100644 --- a/src/parser.pry +++ b/src/parser.pry @@ -1260,7 +1260,8 @@ let parser_parse_import_declaration = (p: *parser) => *Node { strcpy(buf2, dirpath); (*(buf2 + cast(*i8, strlen(dirpath)))) = '/'; strcpy(buf2 + cast(*i8, strlen(dirpath) + 1), impor_filename); - let full_path = realpath(buf2, cast(*i8, null)); + let full_path = cast(*i8, arena_alloc((*p).arena, 250)); + realpath(buf2, full_path); let inner_parser = parser_init(cast(*token, tokens.data), tokens.data_len, (*p).arena, full_path); let ast = parse(inner_parser); |