mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
merges r30820 from trunk into ruby_1_9_2.
-- * process.c (proc_setgroups): add GC guard to prevent intermediate variable from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8c7f9f5cdd
commit
fbb6e25a4d
3 changed files with 9 additions and 2 deletions
|
@ -4464,9 +4464,11 @@ proc_setgroups(VALUE obj, VALUE ary)
|
|||
}
|
||||
else {
|
||||
gr = getgrnam(RSTRING_PTR(tmp));
|
||||
if (gr == NULL)
|
||||
if (gr == NULL) {
|
||||
RB_GC_GUARD(tmp);
|
||||
rb_raise(rb_eArgError,
|
||||
"can't find group for %s", RSTRING_PTR(tmp));
|
||||
}
|
||||
groups[i] = gr->gr_gid;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue