summaryrefslogtreecommitdiffstats
path: root/libs/utils
diff options
context:
space:
mode:
authorLe-Chun Wu <lcwu@google.com>2011-07-14 14:27:18 -0700
committerAlex Ray <aray@google.com>2013-07-30 13:56:57 -0700
commitd8734d19ec3a24f62b5c61af0dd20ec19dc145ec (patch)
tree9d75ed5861b75981e2d174af8822266956c18e8a /libs/utils
parentbbbd761de125b50ac83047bccb0b6e0e32ce74a1 (diff)
downloadsystem_core-d8734d19ec3a24f62b5c61af0dd20ec19dc145ec.zip
system_core-d8734d19ec3a24f62b5c61af0dd20ec19dc145ec.tar.gz
system_core-d8734d19ec3a24f62b5c61af0dd20ec19dc145ec.tar.bz2
Add a call to pthread_attr_destroy to avoid potential memory leaks.
Change-Id: Ib57efc3530e9793298190cc9cab19c9af54e11a7
Diffstat (limited to 'libs/utils')
-rw-r--r--libs/utils/Threads.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index 6d5067b..02c380b 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -161,6 +161,7 @@ int androidCreateRawThreadEtc(android_thread_func_t entryFunction,
pthread_t thread;
int result = pthread_create(&thread, &attr,
(android_pthread_entry)entryFunction, userData);
+ pthread_attr_destroy(&attr);
if (result != 0) {
LOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, errno=%d)\n"
"(android threadPriority=%d)",