From c0865130e4ec5c82d0513d84d5ae16a9b350c2e5 Mon Sep 17 00:00:00 2001 From: fredrik Date: Wed, 25 Oct 2006 20:55:33 +0000 Subject: [PATCH] Close the socket upon erroneous exit as well. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@714 959494ce-11ee-0310-bf91-de5d638817bd --- daemon/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/net.c b/daemon/net.c index 640da3b..3cd12dc 100644 --- a/daemon/net.c +++ b/daemon/net.c @@ -128,6 +128,7 @@ int getpublicaddr(int af, struct sockaddr **addr, socklen_t *lenbuf) } else { free(ipv4); free(conf.ifc_buf); + close(sock); flog(LOG_WARNING, "could not locate an unambiguous interface for determining your public IP address - set net.publicif"); errno = ENFILE; /* XXX: There's no appropriate one for this... */ return(-1); -- 2.11.0