summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-agent.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2000-04-21 00:27:12 +0000
committerDamien Miller <djm@cvs.openbsd.org>2000-04-21 00:27:12 +0000
commit7a56a270d6c8432a50e50000b5a2989c1634c1b1 (patch)
tree0e3cc490343b93252e8d28fbc1ce444c5fc66ef2 /usr.bin/ssh/ssh-agent.c
parentce55f528cac0b956aa688bf588c435355a11fc58 (diff)
Fix memory leak per connection. Report from Andy Spiegl <Andy@Spiegl.de>
via Debian bug #59926
Diffstat (limited to 'usr.bin/ssh/ssh-agent.c')
-rw-r--r--usr.bin/ssh/ssh-agent.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index 39ff3e533e6..17f8d70de09 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.30 2000/04/21 00:27:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -9,7 +9,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.30 2000/04/21 00:27:11 djm Exp $");
#include "ssh.h"
#include "rsa.h"
@@ -436,6 +436,8 @@ after_select(fd_set *readset, fd_set *writeset)
shutdown(sockets[i].fd, SHUT_RDWR);
close(sockets[i].fd);
sockets[i].type = AUTH_UNUSED;
+ buffer_free(&sockets[i].input);
+ buffer_free(&sockets[i].output);
break;
}
buffer_consume(&sockets[i].output, len);
@@ -446,6 +448,8 @@ after_select(fd_set *readset, fd_set *writeset)
shutdown(sockets[i].fd, SHUT_RDWR);
close(sockets[i].fd);
sockets[i].type = AUTH_UNUSED;
+ buffer_free(&sockets[i].input);
+ buffer_free(&sockets[i].output);
break;
}
buffer_append(&sockets[i].input, buf, len);