summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--process.c4
-rw-r--r--version.h2
3 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bc122180cb..f1b6dfb833 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
+
Mon Feb 7 22:56:16 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* lib/benchmark.rb (Benchmark#bmbm): use ensure clause instead of
diff --git a/process.c b/process.c
index e8830504ff..c1804922e1 100644
--- a/process.c
+++ b/process.c
@@ -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;
}
}
diff --git a/version.h b/version.h
index 8ca0761338..1b819bd605 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 196
+#define RUBY_PATCHLEVEL 197
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1