diff options
author | Simo Sorce <simo@redhat.com> | 2014-03-11 18:16:32 -0400 |
---|---|---|
committer | Günther Deschner <gdeschner@redhat.com> | 2014-03-12 14:03:44 +0100 |
commit | f39b471f34b381784a1bd1906bf8335ac2c7ef5e (patch) | |
tree | ee5570b46e76887f3527a705a0a333ea05f10b9a /proxy/src/client | |
parent | c17f20b949d2e80e596ce21ecd944db80aaa80b1 (diff) | |
download | gss-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>
Diffstat (limited to 'proxy/src/client')
-rw-r--r-- | proxy/src/client/gpm_common.c | 3 |
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; } |