]> git.tuebingen.mpg.de Git - paraslash.git/commit
init_tcp_socket: close socket fd on errors
authorAndre <maan@p133.(none)>
Thu, 15 Jun 2006 06:06:44 +0000 (08:06 +0200)
committerAndre <maan@p133.(none)>
Thu, 15 Jun 2006 06:06:44 +0000 (08:06 +0200)
commit0b976cff31e330df80b7a278d5f9d3a0615a644c
tree543ff1aaa4379aba209c23a9402f1426b6678b13
parent68ae99f74f658df5eb53c7ef0127a210e3defd5e
init_tcp_socket: close socket fd on errors

The current code may leak the fd if bind fails, for example.  This is
a benign bug however, since all paraslash applications that call
init_tcp_socket() terminate on errors anyway.

But it is no good idea to rely on this, so close the fd on errors.

This patch also gets rid of the do_bind() one-liner which was only
called from init_tcp_socket().
net.c