From a552faf5646498c12acfd752394e289e4f9a226d Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 21 Apr 2000 15:55:20 +1000 Subject: [PATCH] - Merge fix from OpenBSD CVS [ssh-agent.c] - Fix memory leak per connection. Report from Andy Spiegl via Debian bug #59926 --- ChangeLog | 6 ++++++ ssh-agent.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8e2d70d2..cb810c947 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +20000421 + - Merge fix from OpenBSD CVS + [ssh-agent.c] + - Fix memory leak per connection. Report from Andy Spiegl + via Debian bug #59926 + 20000420 - Make fixpaths work with perl4, patch from Andre Lucas diff --git a/ssh-agent.c b/ssh-agent.c index c9a84a4a0..fb13ce7e1 100644 --- a/ssh-agent.c +++ b/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 @@ -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" @@ -440,6 +440,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); @@ -450,6 +452,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);