From 21c4cd7cb21dc344ff8d42425529805c6d0249aa Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 5 Sep 2005 12:12:55 +0000 Subject: [PATCH 1/2] add a missing freeaddrinfo() --HG-- extra : convert_revision : 861515d7429c76542803c49a1fc972cba6a760b4 --- dbutil.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dbutil.c b/dbutil.c index 45c720e..84fa3ab 100644 --- a/dbutil.c +++ b/dbutil.c @@ -186,6 +186,10 @@ int dropbear_listen(const char* address, const char* port, *errstring = (char*)m_malloc(len); snprintf(*errstring, len, "Error resolving: %s", gai_strerror(err)); } + if (res0) { + freeaddrinfo(res0); + res0 = NULL; + } TRACE(("leave dropbear_listen: failed resolving")) return -1; } @@ -237,6 +241,11 @@ int dropbear_listen(const char* address, const char* port, nsock++; } + if (res0) { + freeaddrinfo(res0); + res0 = NULL; + } + if (nsock == 0) { if (errstring != NULL && *errstring == NULL) { int len; From e7f579b75d10ff7f56e7487bd58171a008db9c29 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 5 Sep 2005 12:13:44 +0000 Subject: [PATCH 2/2] common session initialiser doesn't need to call chansessioninnitialise(), fix up header definition --HG-- extra : convert_revision : 580bc5e6e1413daf46156a181259c244ce1ab174 --- channel.h | 2 +- common-session.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/channel.h b/channel.h index 40f7d15..0f0fcc1 100644 --- a/channel.h +++ b/channel.h @@ -96,7 +96,7 @@ struct ChanType { }; -void chaninitialise(); +void chaninitialise(const struct ChanType *chantypes[]); void chancleanup(); void setchannelfds(fd_set *readfd, fd_set *writefd); void channelio(fd_set *readfd, fd_set *writefd); diff --git a/common-session.c b/common-session.c index 06cdbd1..1b2eb2f 100644 --- a/common-session.c +++ b/common-session.c @@ -62,7 +62,6 @@ void common_session_init(int sock, char* remotehost) { ses.connecttimeout = 0; kexfirstinitialise(); /* initialise the kex state */ - chaninitialise(); /* initialise the channel state */ ses.writepayload = buf_new(MAX_TRANS_PAYLOAD_LEN); ses.transseq = 0;