aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-22 11:15:16 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-22 11:15:16 +0000
commit6e7f56fdc76e0c1b9e19fba776f3cf72c1005e5a (patch)
tree8d37bb7dc4bc58db8af8537e64d85e46b946fe11
parent203ebcbb92db498f093a0b1936a28165b73f5ad3 (diff)
downloadruby-6e7f56fdc76e0c1b9e19fba776f3cf72c1005e5a.tar.gz
* thread_pthread.c (get_stack): fix memory leak; pthread_attr_destory
must be called even when pthread_getattr_np is used. [ruby-core:31269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--thread_pthread.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3193874b18..ac33ac8fcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jul 22 20:12:56 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * thread_pthread.c (get_stack): fix memory leak; pthread_attr_destory
+ must be called even when pthread_getattr_np is used.
+ [ruby-core:31269]
+
Thu Jul 22 16:27:41 2010 NARUSE, Yui <naruse@ruby-lang.org>
* re.c (rb_reg_expr_str): fix broken Regexp#inspect when it
diff --git a/thread_pthread.c b/thread_pthread.c
index e974b73e6f..e832b82fe1 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -226,9 +226,7 @@ get_stack(void **addr, size_t *size)
# endif
CHECK_ERR(pthread_attr_getguardsize(&attr, &guard));
*size -= guard;
-# ifndef HAVE_PTHREAD_GETATTR_NP
pthread_attr_destroy(&attr);
-# endif
#elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP
pthread_t th = pthread_self();
*addr = pthread_get_stackaddr_np(th);