Fix memory leak when direct TCP connections time out on connection.

Long-standing bug probably stemming from the awkwardly named
delete_channel() versus remove_channel()
This commit is contained in:
Matt Johnston
2013-03-19 23:54:32 +08:00
parent 8393c5f016
commit 4fd4fbc255
2 changed files with 40 additions and 29 deletions

View File

@@ -61,7 +61,8 @@ struct Channel {
int readfd; /* read from insecure side, written to wire */
int errfd; /* used like writefd or readfd, depending if it's client or server.
Doesn't exactly belong here, but is cleaner here */
circbuffer *writebuf; /* data from the wire, for local consumption */
circbuffer *writebuf; /* data from the wire, for local consumption. Can be
initially NULL */
circbuffer *extrabuf; /* extended-data for the program - used like writebuf
but for stderr */
@@ -102,9 +103,6 @@ void chancleanup();
void setchannelfds(fd_set *readfd, fd_set *writefd);
void channelio(fd_set *readfd, fd_set *writefd);
struct Channel* getchannel();
struct Channel* newchannel(unsigned int remotechan,
const struct ChanType *type,
unsigned int transwindow, unsigned int transmaxpacket);
void recv_msg_channel_open();
void recv_msg_channel_request();