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;
}

View File

@@ -52,10 +52,6 @@ proto (int sock, const char *hostname, const char *service)
krb5_data packet;
u_int32_t len, net_len;
status = krb5_init_context(&context);
if (status)
krb5_err (context, 1, status, "krb5_init_context");
status = krb5_auth_con_init (context, &auth_context);
if (status)
krb5_err (context, 1, status, "krb5_auth_con_init");
@@ -170,8 +166,10 @@ doit (const char *hostname, int port, const char *service)
close (s);
continue;
}
freehostent (hostent);
return proto (s, hostname, service);
}
freehostent (hostent);
return 1;
}