summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--thread_pthread.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7803c5edcf..3ace8afbea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jul 22 22:13:48 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]
+
Wed Jul 21 12:39:15 2010 Yusuke Endoh <mame@tsg.ne.jp>
* lib/cmath.rb (CMath#cbrt): cbrt should accept a negative real
diff --git a/thread_pthread.c b/thread_pthread.c
index 95fb77a7f8..c2fde5c82e 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -234,9 +234,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);