summaryrefslogtreecommitdiff
path: root/main/lock.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2013-05-15 15:58:56 +0000
committerKevin Harwell <kharwell@digium.com>2013-05-15 15:58:56 +0000
commit2eebab399286199e7d4b57d9cb0b9847e98a698a (patch)
tree2502d84124890d237419065d504c7fbf72ee93dd /main/lock.c
parentd8d1def22c060612c82c9ae78e794ce45004a530 (diff)
Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS
If DEBUG_THREADS is enabled __ast_rwlock_destroy causes a segfault while trying to access a possible NULL t->track object. A NULL check has been added before trying to access the memory. (closes issue ASTERISK-21724) Reported by: Corey Farrell Fixed by: Corey Farrell Patches: ast_rwlock_destroy-segv.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 388838 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388839 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/lock.c')
-rw-r--r--main/lock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/lock.c b/main/lock.c
index 3c9fbd4db..902d63119 100644
--- a/main/lock.c
+++ b/main/lock.c
@@ -745,7 +745,7 @@ int __ast_rwlock_destroy(const char *filename, int lineno, const char *func, con
__ast_mutex_logger("%s line %d (%s): Error destroying rwlock %s: %s\n",
filename, lineno, func, rwlock_name, strerror(res));
}
- if (t->tracking) {
+ if (t->tracking && lt) {
ast_reentrancy_lock(lt);
lt->file[0] = filename;
lt->lineno[0] = lineno;