about summary refs log tree commit homepage
path: root/ext/posix_mq/posix_mq.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-03-13 00:22:22 -0800
committerEric Wong <normalperson@yhbt.net>2010-03-13 00:22:22 -0800
commit437cbe78cb0f239e34f9dbf1341f5b85f96f2f25 (patch)
treef8f244f5e71fb315d971da021b881567d5f5c425 /ext/posix_mq/posix_mq.c
parent74e1f75b238416d9ac402f291431a5e457ae313f (diff)
downloadruby_posix_mq-437cbe78cb0f239e34f9dbf1341f5b85f96f2f25.tar.gz
We don't want folks to accidentally clobber the value for
others, so allocate a new string object for it (don't worry,
rb_str_dup() is cheap in 1.9).
Diffstat (limited to 'ext/posix_mq/posix_mq.c')
-rw-r--r--ext/posix_mq/posix_mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/posix_mq/posix_mq.c b/ext/posix_mq/posix_mq.c
index 80943fb..d9abf1e 100644
--- a/ext/posix_mq/posix_mq.c
+++ b/ext/posix_mq/posix_mq.c
@@ -685,7 +685,7 @@ static VALUE name(VALUE self)
 {
         struct posix_mq *mq = get(self, 0);
 
-        return mq->name;
+        return rb_str_dup(mq->name);
 }
 
 static int lookup_sig(VALUE sig)