Eggdev: Re: [eggheads-patches] PATCH 1.6/1.7: Leaked socklist socket

Will Buckner wcc at techmonkeys.org
Fri Apr 15 21:08:33 CST 2005


Bryan Drewery wrote:

> open_telnet_raw() is passed a socket from getsock()
> if the socket is failed in bind() open_telnet_raw does a return -1, 
> leaving the socket floating around in the socklist.
> This patch fixes for both trees.
>
> diff -u -d -p -r1.12 net.c
> --- src/net.c   26 Nov 2004 05:35:27 -0000      1.12
> +++ src/net.c   25 Jan 2005 17:41:33 -0000
> @@ -394,8 +394,10 @@ int open_telnet_raw(int sock, char *serv
>
>    name.sin_family = AF_INET;
>    name.sin_addr.s_addr = (myip[0] ? getmyip() : INADDR_ANY);
> -  if (bind(sock, (struct sockaddr *) &name, sizeof(name)) < 0)
> +  if (bind(sock, (struct sockaddr *) &name, sizeof(name)) < 0) {
> +    killsock(sock);
>      return -1;
> +  }
>    egg_bzero((char *) &name, sizeof(struct sockaddr_in));
>
>    name.sin_family = AF_INET;
>
>
> ------
> Bryan Drewery
>
Did this ever get applied?

Will



More information about the Eggdev mailing list