Close the socket upon erroneous exit as well.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Wed, 25 Oct 2006 20:55:33 +0000 (20:55 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Wed, 25 Oct 2006 20:55:33 +0000 (20:55 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@714 959494ce-11ee-0310-bf91-de5d638817bd

daemon/net.c

index 640da3b..3cd12dc 100644 (file)
@@ -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);