mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix double free when getcwd
does not allocate buffer
Do not free the result at normal return from `ruby_getcwd`.
This commit is contained in:
parent
05502c1dda
commit
03a0ade90d
Notes:
git
2024-07-17 07:17:42 +00:00
1 changed files with 1 additions and 1 deletions
2
util.c
2
util.c
|
@ -564,7 +564,7 @@ ruby_getcwd(void)
|
|||
rb_imemo_tmpbuf_set_ptr(guard, buf);
|
||||
buf = xrealloc(buf, size);
|
||||
}
|
||||
rb_free_tmp_buffer(&guard);
|
||||
rb_imemo_tmpbuf_set_ptr(guard, NULL);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue