Free a buffer allocated by realpath
8350b48cfa7d344d9e2dc9748c26607c1b89d7df introduced a memory leak bug. Will fix [Bug #20773] `loop { File.realpath("foo") }` caused memory leak.
This commit is contained in:
parent
5ed67f4826
commit
b93c51c114
Notes:
git
2024-09-30 11:36:05 +00:00
2
file.c
2
file.c
@ -4582,7 +4582,7 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, rb_encoding *origenc, enum
|
||||
rb_sys_fail_path(unresolved_path);
|
||||
}
|
||||
resolved = ospath_new(resolved_ptr, strlen(resolved_ptr), rb_filesystem_encoding());
|
||||
# if defined(NEEDS_REALPATH_BUFFER) && NEEDS_REALPATH_BUFFER
|
||||
# if !(defined(NEEDS_REALPATH_BUFFER) && NEEDS_REALPATH_BUFFER)
|
||||
free(resolved_ptr);
|
||||
# endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user