Merged revisions 164736 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164736 | russell | 2008-12-16 11:06:29 -0600 (Tue, 16 Dec 2008) | 14 lines

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: https://origsvn.digium.com/svn/asterisk/trunk@164737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2008-12-16 17:14:01 +00:00
parent 601176cb6e
commit 556b082522
2 changed files with 28 additions and 12 deletions

View File

@@ -204,7 +204,7 @@ void *__ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size, co
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;