Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS
[asterisk/asterisk.git] / main / lock.c
index 3c9fbd4..902d631 100644 (file)
@@ -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;