call freehostent

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6756 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-08-05 12:22:09 +00:00
parent 3b5d22066c
commit 538358295d
2 changed files with 8 additions and 5 deletions

View File

@@ -571,8 +571,10 @@ doit_broken (int argc,
if (connect(priv_socket1, addr, socket_sockaddr_size(addr)) < 0) {
char **h;
if (hostent->h_addr_list[1] == NULL)
if (hostent->h_addr_list[1] == NULL) {
freehostent (hostent);
return 1;
}
close(priv_socket1);
close(priv_socket2);
@@ -658,6 +660,7 @@ doit (const char *hostname,
errx (1, "gethostbyname '%s' failed: %s",
hostname,
hstrerror(error));
af = hostent->h_addrtype;
for (h = hostent->h_addr_list; *h != NULL; ++h) {
int s;
@@ -690,6 +693,7 @@ doit (const char *hostname,
} else
errsock = -1;
freehostent (hostent);
ret = proto (s, errsock,
hostname,
local_user, remote_user,
@@ -697,6 +701,7 @@ doit (const char *hostname,
close (s);
return ret;
}
freehostent (hostent);
return 1;
}