diff options
author | Ken Raeburn <raeburn@mit.edu> | 2008-08-06 00:01:37 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2008-08-06 00:01:37 +0000 |
commit | 9b008de9287d1b8bb5f9a69fe4e26352e1477735 (patch) | |
tree | 38251f22dde80416a93b0882a2777ce51a640a83 /src/tests | |
parent | 1e16ad43bbee9103821669626ce898b532956773 (diff) | |
download | krb5-9b008de9287d1b8bb5f9a69fe4e26352e1477735.zip krb5-9b008de9287d1b8bb5f9a69fe4e26352e1477735.tar.gz krb5-9b008de9287d1b8bb5f9a69fe4e26352e1477735.tar.bz2 |
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')
-rw-r--r-- | src/tests/gss-threads/gss-client.c | 3 | ||||
-rw-r--r-- | src/tests/gss-threads/gss-server.c | 3 |
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 f199dc2..25c9d63 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 009c4f0..bc22f83 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; } |