mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Close agent named-pipe handles when queries complete.
I was cleaning up the 'struct handle', but not the underlying HANDLE.
As a result, any PuTTY process that makes a request to Pageant keeps
the named pipe connection open until the end of the process's
lifetime.
(cherry picked from commit 6e69223dc2
)
This commit is contained in:
parent
6976bf6082
commit
11b89407f5
@ -169,6 +169,7 @@ bool agent_exists(void)
|
|||||||
|
|
||||||
struct agent_pending_query {
|
struct agent_pending_query {
|
||||||
struct handle *handle;
|
struct handle *handle;
|
||||||
|
HANDLE os_handle;
|
||||||
strbuf *response;
|
strbuf *response;
|
||||||
void (*callback)(void *, void *, int);
|
void (*callback)(void *, void *, int);
|
||||||
void *callback_ctx;
|
void *callback_ctx;
|
||||||
@ -266,6 +267,7 @@ static agent_pending_query *named_pipe_agent_query(
|
|||||||
|
|
||||||
pq = snew(agent_pending_query);
|
pq = snew(agent_pending_query);
|
||||||
pq->handle = handle_input_new(pipehandle, named_pipe_agent_gotdata, pq, 0);
|
pq->handle = handle_input_new(pipehandle, named_pipe_agent_gotdata, pq, 0);
|
||||||
|
pq->os_handle = pipehandle;
|
||||||
pipehandle = INVALID_HANDLE_VALUE; /* prevent it being closed below */
|
pipehandle = INVALID_HANDLE_VALUE; /* prevent it being closed below */
|
||||||
pq->response = strbuf_new_nm();
|
pq->response = strbuf_new_nm();
|
||||||
pq->callback = callback;
|
pq->callback = callback;
|
||||||
@ -290,6 +292,7 @@ static agent_pending_query *named_pipe_agent_query(
|
|||||||
void agent_cancel_query(agent_pending_query *pq)
|
void agent_cancel_query(agent_pending_query *pq)
|
||||||
{
|
{
|
||||||
handle_free(pq->handle);
|
handle_free(pq->handle);
|
||||||
|
CloseHandle(pq->os_handle);
|
||||||
if (pq->response)
|
if (pq->response)
|
||||||
strbuf_free(pq->response);
|
strbuf_free(pq->response);
|
||||||
sfree(pq);
|
sfree(pq);
|
||||||
|
Loading…
Reference in New Issue
Block a user