diff --git a/ChangeLog b/ChangeLog index 46747c1300..4da000a17e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 8 01:00:21 2011 CHIKANAGA Tomoyuki + + * process.c (proc_setgroups): add GC guard to prevent intermediate + variable from GC. + Tue Feb 8 00:56:33 2011 Nobuyoshi Nakada * misc/ruby-mode.el (ruby-expr-beg, ruby-in-here-doc-p): tell diff --git a/process.c b/process.c index f957d24613..df0350e3f2 100644 --- a/process.c +++ b/process.c @@ -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; } }