summaryrefslogtreecommitdiff
path: root/thread_pthread.c
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 /thread_pthread.c
parent203ebcbb92db498f093a0b1936a28165b73f5ad3 (diff)
* 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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c2
1 files changed, 0 insertions, 2 deletions
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);