summaryrefslogtreecommitdiffhomepage
path: root/svr-agentfwd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2011-04-07 13:25:00 +0000
committerMatt Johnston <matt@ucc.asn.au>2011-04-07 13:25:00 +0000
commit22c16a8b71d6ba3d5dc9c4ec1343c9abceb38837 (patch)
tree8c19f9cb6e1e34945d879818ece2e1cdeacd30a8 /svr-agentfwd.c
parentf924aa18f2ec5320c2f30169df2aef4428675e9c (diff)
Clean up fd on failure. Found by Klocwork
--HG-- extra : convert_revision : 4b999175c8e91ee3ddf283b17525999499a12849
Diffstat (limited to 'svr-agentfwd.c')
-rw-r--r--svr-agentfwd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/svr-agentfwd.c b/svr-agentfwd.c
index 054a3b5..3010503 100644
--- a/svr-agentfwd.c
+++ b/svr-agentfwd.c
@@ -50,10 +50,7 @@ static void agentaccept(struct Listener * listener, int sock);
/* Handles client requests to start agent forwarding, sets up listening socket.
* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
int svr_agentreq(struct ChanSess * chansess) {
-
- int fd;
-
- TRACE(("enter svr_agentreq"))
+ int fd = -1;
if (!svr_pubkey_allows_agentfwd()) {
return DROPBEAR_FAILURE;
@@ -91,10 +88,9 @@ int svr_agentreq(struct ChanSess * chansess) {
}
return DROPBEAR_SUCCESS;
- TRACE(("success"))
fail:
- TRACE(("fail"))
+ m_close(fd);
/* cleanup */
svr_agentcleanup(chansess);