From 437cbe78cb0f239e34f9dbf1341f5b85f96f2f25 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 13 Mar 2010 00:22:22 -0800 Subject: ensure POSIX_MQ#name is clobber-proof 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). --- ext/posix_mq/posix_mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/posix_mq/posix_mq.c') 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) -- cgit v1.2.3-24-ge0c7