diff --git a/channels/sshagent/CMakeLists.txt b/channels/sshagent/CMakeLists.txt index bc6cb2fc5..fc3716989 100644 --- a/channels/sshagent/CMakeLists.txt +++ b/channels/sshagent/CMakeLists.txt @@ -2,6 +2,7 @@ # FreeRDP cmake build script # # Copyright 2012 Marc-Andre Moreau +# Copyright 2012 Ben Cohen # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/channels/sshagent/client/CMakeLists.txt b/channels/sshagent/client/CMakeLists.txt index bf8b1b8f8..fa4db5e0c 100644 --- a/channels/sshagent/client/CMakeLists.txt +++ b/channels/sshagent/client/CMakeLists.txt @@ -2,6 +2,7 @@ # FreeRDP cmake build script # # Copyright 2012 Marc-Andre Moreau +# Copyright 2012 Ben Cohen # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/channels/sshagent/client/sshagent_main.c b/channels/sshagent/client/sshagent_main.c index 61e6aaa1f..94d96c119 100644 --- a/channels/sshagent/client/sshagent_main.c +++ b/channels/sshagent/client/sshagent_main.c @@ -115,6 +115,7 @@ static int connect_to_sshagent(const char *udspath) { WLog_ERR(TAG, "Can't connect to Unix domain socket \"%s\"!", udspath); + close(agent_fd); return -1; } @@ -293,13 +294,14 @@ static UINT sshagent_on_new_channel_connection(IWTSListenerCallback* pListenerCa callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; - if (!(callback->thread - = CreateThread(NULL, - 0, - (LPTHREAD_START_ROUTINE) sshagent_read_thread, - (void*) callback, - 0, - NULL))) + callback->thread + = CreateThread(NULL, + 0, + (LPTHREAD_START_ROUTINE) sshagent_read_thread, + (void*) callback, + 0, + NULL); + if (!callback->thread) { WLog_ERR(TAG, "CreateThread failed!"); return CHANNEL_RC_INITIALIZATION_ERROR;