From 81b2548fef64f1d278ac02ff27aa0055b84c3776 Mon Sep 17 00:00:00 2001 From: Zenju Date: Tue, 2 Jul 2019 00:01:13 +0200 Subject: [PATCH] Agent.c : Preserve error info from agent_list_identities() (#374) Files : agent.c Notes : Currently the error details as returned by agent_transact_pageant() are overwritten by a generic "agent list id failed" message by int agent_list_identities(LIBSSH2_AGENT* agent). Credit : Zenju --- src/agent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agent.c b/src/agent.c index 0c8d8816..07400fb8 100644 --- a/src/agent.c +++ b/src/agent.c @@ -522,7 +522,9 @@ agent_list_identities(LIBSSH2_AGENT *agent) rc = agent->ops->transact(agent, transctx); if(rc) { - goto error; + LIBSSH2_FREE(agent->session, transctx->response); + transctx->response = NULL; + return rc; } transctx->request = NULL;