Blame SOURCES/gssproxy-0.3.1-deadlock_fix.patch

4c520e
From f39b471f34b381784a1bd1906bf8335ac2c7ef5e Mon Sep 17 00:00:00 2001
4c520e
From: Simo Sorce <simo@redhat.com>
4c520e
Date: Tue, 11 Mar 2014 18:16:32 -0400
4c520e
Subject: [PATCH] Properly cleanup mutex on failure.
4c520e
MIME-Version: 1.0
4c520e
Content-Type: text/plain; charset=UTF-8
4c520e
Content-Transfer-Encoding: 8bit
4c520e
4c520e
If the call to create socket fails we leave a dangling lock and the client
4c520e
enters into a deadlock on the next call.
4c520e
4c520e
Fixes: https://fedorahosted.org/gss-proxy/ticket/121
4c520e
4c520e
Signed-off-by: Simo Sorce <simo@redhat.com>
4c520e
Reviewed-by: Günther Deschner <gdeschner@redhat.com>
4c520e
---
4c520e
 proxy/src/client/gpm_common.c | 3 +++
4c520e
 1 file changed, 3 insertions(+)
4c520e
4c520e
diff --git a/proxy/src/client/gpm_common.c b/proxy/src/client/gpm_common.c
4c520e
index 74296da..4651194 100644
4c520e
--- a/proxy/src/client/gpm_common.c
4c520e
+++ b/proxy/src/client/gpm_common.c
4c520e
@@ -153,6 +153,9 @@ static int gpm_grab_sock(struct gpm_ctx *gpmctx)
4c520e
         ret = gpm_open_socket(gpmctx);
4c520e
     }
4c520e
 
4c520e
+    if (ret) {
4c520e
+        pthread_mutex_unlock(&gpmctx->lock);
4c520e
+    }
4c520e
     return ret;
4c520e
 }
4c520e
 
4c520e
-- 
4c520e
1.8.5.3
4c520e