summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-03-11 18:16:32 -0400
committerGünther Deschner <gdeschner@redhat.com>2014-03-12 14:03:44 +0100
commitf39b471f34b381784a1bd1906bf8335ac2c7ef5e (patch)
treeee5570b46e76887f3527a705a0a333ea05f10b9a
parentc17f20b949d2e80e596ce21ecd944db80aaa80b1 (diff)
downloadgss-proxy-f39b471f34b381784a1bd1906bf8335ac2c7ef5e.tar.gz
gss-proxy-f39b471f34b381784a1bd1906bf8335ac2c7ef5e.tar.xz
gss-proxy-f39b471f34b381784a1bd1906bf8335ac2c7ef5e.zip
Properly cleanup mutex on failure.
If the call to create socket fails we leave a dangling lock and the client enters into a deadlock on the next call. Fixes: https://fedorahosted.org/gss-proxy/ticket/121 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
-rw-r--r--proxy/src/client/gpm_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/proxy/src/client/gpm_common.c b/proxy/src/client/gpm_common.c
index 74296da..4651194 100644
--- a/proxy/src/client/gpm_common.c
+++ b/proxy/src/client/gpm_common.c
@@ -153,6 +153,9 @@ static int gpm_grab_sock(struct gpm_ctx *gpmctx)
ret = gpm_open_socket(gpmctx);
}
+ if (ret) {
+ pthread_mutex_unlock(&gpmctx->lock);
+ }
return ret;
}