From: fredrik Date: Wed, 25 Oct 2006 20:55:33 +0000 (+0000) Subject: Close the socket upon erroneous exit as well. X-Git-Tag: 0.3~209 X-Git-Url: http://dolda2000.com/gitweb/?p=doldaconnect.git;a=commitdiff_plain;h=c0865130e4ec5c82d0513d84d5ae16a9b350c2e5 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 --- 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);