diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-03-13 00:22:22 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-03-13 00:22:22 -0800 |
commit | 437cbe78cb0f239e34f9dbf1341f5b85f96f2f25 (patch) | |
tree | f8f244f5e71fb315d971da021b881567d5f5c425 /ext/posix_mq/posix_mq.c | |
parent | 74e1f75b238416d9ac402f291431a5e457ae313f (diff) | |
download | ruby_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.c | 2 |
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) |