mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* process.c (proc_setgroups): add GC guard to prevent intermediate
variable from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5f3e191f95
commit
012e60f61c
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Feb 8 01:00:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
|
||||
|
||||
* process.c (proc_setgroups): add GC guard to prevent intermediate
|
||||
variable from GC.
|
||||
|
||||
Tue Feb 8 00:56:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* misc/ruby-mode.el (ruby-expr-beg, ruby-in-here-doc-p): tell
|
||||
|
|
|
@ -4608,9 +4608,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…
Reference in a new issue