summaryrefslogtreecommitdiffstats
path: root/src/tests/gss-threads
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-08-06 00:01:37 +0000
committerKen Raeburn <raeburn@mit.edu>2008-08-06 00:01:37 +0000
commit9b008de9287d1b8bb5f9a69fe4e26352e1477735 (patch)
tree38251f22dde80416a93b0882a2777ce51a640a83 /src/tests/gss-threads
parent1e16ad43bbee9103821669626ce898b532956773 (diff)
downloadkrb5-9b008de9287d1b8bb5f9a69fe4e26352e1477735.tar.gz
krb5-9b008de9287d1b8bb5f9a69fe4e26352e1477735.tar.xz
krb5-9b008de9287d1b8bb5f9a69fe4e26352e1477735.zip
Fix possible locking protocol failure in error handling path
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20607 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/tests/gss-threads')
-rw-r--r--src/tests/gss-threads/gss-client.c3
-rw-r--r--src/tests/gss-threads/gss-server.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/tests/gss-threads/gss-client.c b/src/tests/gss-threads/gss-client.c
index f199dc2524..25c9d63ee6 100644
--- a/src/tests/gss-threads/gss-client.c
+++ b/src/tests/gss-threads/gss-client.c
@@ -20,7 +20,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
- * Copyright (C) 2003, 2004 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2003, 2004, 2008 by the Massachusetts Institute of Technology.
* All rights reserved.
*
* Export of this software from the United States of America may
@@ -703,6 +703,7 @@ WaitAndIncrementThreadCounter(void)
if (counter == max_threads) {
err = pthread_cond_wait(&counter_cond, &counter_mutex);
if (err) {
+ pthread_mutex_unlock(&counter_mutex);
perror("pthread_cond_wait");
return 0;
}
diff --git a/src/tests/gss-threads/gss-server.c b/src/tests/gss-threads/gss-server.c
index 009c4f0863..bc22f83e5b 100644
--- a/src/tests/gss-threads/gss-server.c
+++ b/src/tests/gss-threads/gss-server.c
@@ -20,7 +20,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
- * Copyright (C) 2004 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2004,2008 by the Massachusetts Institute of Technology.
* All rights reserved.
*
* Export of this software from the United States of America may
@@ -637,6 +637,7 @@ WaitAndIncrementThreadCounter(void)
if (counter == max_threads) {
err = pthread_cond_wait(&counter_cond, &counter_mutex);
if (err) {
+ pthread_mutex_unlock(&counter_mutex);
perror("pthread_cond_wait");
return 0;
}