Fix socket fd leak and other changes
1. In connect_to_sshagent() if connect() fails, the socket agent_fd is leaked. It needs to be closed before returning. 2. Fix copyright messages. 3. Make if statement with call to CreateThread() clearer to read.
This commit is contained in:
parent
0e90841a18
commit
7e262213ca
@ -2,6 +2,7 @@
|
|||||||
# FreeRDP cmake build script
|
# FreeRDP cmake build script
|
||||||
#
|
#
|
||||||
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||||
|
# Copyright 2012 Ben Cohen
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# FreeRDP cmake build script
|
# FreeRDP cmake build script
|
||||||
#
|
#
|
||||||
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||||
|
# Copyright 2012 Ben Cohen
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -115,6 +115,7 @@ static int connect_to_sshagent(const char *udspath)
|
|||||||
{
|
{
|
||||||
WLog_ERR(TAG, "Can't connect to Unix domain socket \"%s\"!",
|
WLog_ERR(TAG, "Can't connect to Unix domain socket \"%s\"!",
|
||||||
udspath);
|
udspath);
|
||||||
|
close(agent_fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,13 +294,14 @@ static UINT sshagent_on_new_channel_connection(IWTSListenerCallback* pListenerCa
|
|||||||
callback->channel_mgr = listener_callback->channel_mgr;
|
callback->channel_mgr = listener_callback->channel_mgr;
|
||||||
callback->channel = pChannel;
|
callback->channel = pChannel;
|
||||||
|
|
||||||
if (!(callback->thread
|
callback->thread
|
||||||
= CreateThread(NULL,
|
= CreateThread(NULL,
|
||||||
0,
|
0,
|
||||||
(LPTHREAD_START_ROUTINE) sshagent_read_thread,
|
(LPTHREAD_START_ROUTINE) sshagent_read_thread,
|
||||||
(void*) callback,
|
(void*) callback,
|
||||||
0,
|
0,
|
||||||
NULL)))
|
NULL);
|
||||||
|
if (!callback->thread)
|
||||||
{
|
{
|
||||||
WLog_ERR(TAG, "CreateThread failed!");
|
WLog_ERR(TAG, "CreateThread failed!");
|
||||||
return CHANNEL_RC_INITIALIZATION_ERROR;
|
return CHANNEL_RC_INITIALIZATION_ERROR;
|
||||||
|
Loading…
Reference in New Issue
Block a user