Merge "lock.c: Check *lt before dereferencing it"

This commit is contained in:
zuul
2016-04-21 13:01:56 -05:00
committed by Gerrit Code Review

View File

@@ -286,6 +286,7 @@ int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func,
if (wait_time > reported_wait && (wait_time % 5) == 0) {
__ast_mutex_logger("%s line %d (%s): Deadlock? waited %d sec for mutex '%s'?\n",
filename, lineno, func, (int) wait_time, mutex_name);
if (lt) {
ast_reentrancy_lock(lt);
#ifdef HAVE_BKTR
__dump_backtrace(&lt->backtrace[lt->reentrancy], canlog);
@@ -297,6 +298,7 @@ int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func,
__dump_backtrace(&lt->backtrace[ROFFSET], canlog);
#endif
ast_reentrancy_unlock(lt);
}
reported_wait = wait_time;
}
usleep(200);