X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fnet.c;h=641c5a2d52d81920416ef71b4edd3ac40f307343;hb=bcb73bb32988c44f64778c776621471a3bba2eca;hp=a5ff11392c01ecaed3d901ec8b280e8877cb4c57;hpb=c74516fb4f73c64a0aa6eb720b3cfc5440636ba5;p=doldaconnect.git diff --git a/daemon/net.c b/daemon/net.c index a5ff113..641c5a2 100644 --- a/daemon/net.c +++ b/daemon/net.c @@ -90,7 +90,7 @@ int getpublicaddr(int af, struct sockaddr **addr, socklen_t *lenbuf) *lenbuf = sizeof(*ipv4); return(0); } - if((pif = icwcstombs(confgetstr("net", "publicif"), NULL)) == NULL) + if((pif = icswcstombs(confgetstr("net", "publicif"), NULL, NULL)) == NULL) { flog(LOG_ERR, "could not convert net.publicif into local charset: %s", strerror(errno)); return(-1); @@ -128,12 +128,14 @@ int getpublicaddr(int af, struct sockaddr **addr, socklen_t *lenbuf) memcpy(ipv4, &ifr->ifr_addr, sizeof(ifr->ifr_addr)); } else { free(ipv4); + free(conf.ifc_buf); 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); } } } + free(conf.ifc_buf); close(sock); if(ipv4 != NULL) {