From a8ed9b898568b200e17dd14b51d83bc70601d162 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 28 Jul 2014 17:38:35 +0200 Subject: use of mutexe when removing protocols due to server closing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-registry.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mds-registry.c b/src/mds-registry.c index b16e8d9..b0c6962 100644 --- a/src/mds-registry.c +++ b/src/mds-registry.c @@ -485,6 +485,8 @@ static int handle_close_message(void) size_t* keys = NULL; size_t* old_keys; + fail_if ((errno = pthread_mutex_lock(®_mutex))); + for (i = 0; i < received.header_count; i++) if (startswith(received.headers[i], "Client closed: ")) { @@ -518,6 +520,8 @@ static int handle_close_message(void) free(command); } + pthread_mutex_unlock(®_mutex); + free(keys); return 0; pfail: -- cgit v1.2.3-70-g09d2