diff --git a/src/net/tcp.c b/src/net/tcp.c index 06c66c95..830e8d50 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -277,6 +277,7 @@ static void tcp_close ( struct tcp_connection *tcp, int rc ) { stop_timer ( &tcp->timer ); list_del ( &tcp->list ); ref_put ( &tcp->refcnt ); + DBGC ( tcp, "TCP %p connection deleted\n", tcp ); return; } @@ -980,6 +981,10 @@ struct socket_opener tcp_socket_opener __socket_opener = { static int tcp_open_uri ( struct xfer_interface *xfer, struct uri *uri ) { struct sockaddr_tcpip peer; + /* Sanity check */ + if ( ! uri->host ) + return -EINVAL; + memset ( &peer, 0, sizeof ( peer ) ); peer.st_port = htons ( uri_port ( uri, 0 ) ); return xfer_open_named_socket ( xfer, SOCK_STREAM,