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:
yugui 2011-05-11 21:23:31 +00:00
parent 8c7f9f5cdd
commit fbb6e25a4d
3 changed files with 9 additions and 2 deletions

View file

@ -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;
}
}