aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-16 17:06:29 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-16 17:06:29 +0000
commit1b0180203b9b92fd2fe1c453736040097494bbcf (patch)
tree93bdf1f918ec5d5e420d1c871ac4a69a82624ac5 /include
parent04d03a5a078adb1eaa2b2d6e316bf2343e91c300 (diff)
Fix memory leak and invalid reporting issues with DEBUG_THREADLOCALS.
One issue was that the ast_mutex_* API was being used within the context of the thread local data destructors. We would go off and allocate more thread local data while the pthread lib was in the middle of destroying it all. This led to a memory leak. Another issue was an invalid argument being provided to the the object_add API call. (closes issue #13678) Reported by: ys Tested by: russell git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164736 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/threadstorage.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h
index 2934a320b..3829b8f1a 100644
--- a/include/asterisk/threadstorage.h
+++ b/include/asterisk/threadstorage.h
@@ -159,7 +159,7 @@ void *__ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size, co
if (!(buf = ast_calloc(1, init_size)))
return NULL;
pthread_setspecific(ts->key, buf);
- __ast_threadstorage_object_add(&ts->key, init_size, file, function, line);
+ __ast_threadstorage_object_add(buf, init_size, file, function, line);
}
return buf;