From 9b008de9287d1b8bb5f9a69fe4e26352e1477735 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 6 Aug 2008 00:01:37 +0000 Subject: [PATCH] Fix possible locking protocol failure in error handling path git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20607 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/gss-threads/gss-client.c | 3 ++- 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 f199dc252..25c9d63ee 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 009c4f086..bc22f83e5 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; } -- 2.26.2