aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-17 22:05:49 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-17 22:05:49 +0000
commitbccb813cf2636fa4a9ecf3658ddf9b063a1903e2 (patch)
tree50e7eeded939f340171e06941c0dea988369f0d4 /main
parent51deae6abe51f4461956d4434c44806df6530665 (diff)
Fix a logic flaw in the code that stores lock info which is displayed
via the "core show locks" command. The idea behind this section of code was to remove the previous lock from the list if it was a trylock that had failed. Unfortunately, instead of checking the status of the previous lock, we were referencing the index immediately following the previous lock in the lock_info->locks array. The result of this problem, under the right circumstances, was that the lock which we currently in the process of attempting to acquire could "overwrite" the previous lock which was acquired. While this does not in any way affect typical operation, it *could* lead to misleading "core show locks" output. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109226 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c
index 755789c72..36fd0d1ba 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -611,7 +611,7 @@ void ast_store_lock_info(enum ast_lock_type type, const char *filename,
return;
}
- if (i && lock_info->locks[i].pending == -1) {
+ if (i && lock_info->locks[i-1].pending == -1) {
/* The last lock on the list was one that this thread tried to lock but
* failed at doing so. It has now moved on to something else, so remove
* the old lock from the list. */