call freehostent
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6756 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -571,8 +571,10 @@ doit_broken (int argc, | |||||||
|     if (connect(priv_socket1, addr, socket_sockaddr_size(addr)) < 0) { |     if (connect(priv_socket1, addr, socket_sockaddr_size(addr)) < 0) { | ||||||
| 	char **h; | 	char **h; | ||||||
|  |  | ||||||
| 	if (hostent->h_addr_list[1] == NULL) | 	if (hostent->h_addr_list[1] == NULL) { | ||||||
|  | 	    freehostent (hostent); | ||||||
| 	    return 1; | 	    return 1; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	close(priv_socket1); | 	close(priv_socket1); | ||||||
| 	close(priv_socket2); | 	close(priv_socket2); | ||||||
| @@ -658,6 +660,7 @@ doit (const char *hostname, | |||||||
| 	errx (1, "gethostbyname '%s' failed: %s", | 	errx (1, "gethostbyname '%s' failed: %s", | ||||||
| 	      hostname, | 	      hostname, | ||||||
| 	      hstrerror(error)); | 	      hstrerror(error)); | ||||||
|  |  | ||||||
|     af = hostent->h_addrtype; |     af = hostent->h_addrtype; | ||||||
|     for (h = hostent->h_addr_list; *h != NULL; ++h) { |     for (h = hostent->h_addr_list; *h != NULL; ++h) { | ||||||
| 	int s; | 	int s; | ||||||
| @@ -690,6 +693,7 @@ doit (const char *hostname, | |||||||
| 	} else | 	} else | ||||||
| 	    errsock = -1; | 	    errsock = -1; | ||||||
|      |      | ||||||
|  | 	freehostent (hostent); | ||||||
| 	ret = proto (s, errsock, | 	ret = proto (s, errsock, | ||||||
| 		     hostname, | 		     hostname, | ||||||
| 		     local_user, remote_user, | 		     local_user, remote_user, | ||||||
| @@ -697,6 +701,7 @@ doit (const char *hostname, | |||||||
| 	close (s); | 	close (s); | ||||||
| 	return ret; | 	return ret; | ||||||
|     } |     } | ||||||
|  |     freehostent (hostent); | ||||||
|     return 1; |     return 1; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -52,10 +52,6 @@ proto (int sock, const char *hostname, const char *service) | |||||||
|     krb5_data packet; |     krb5_data packet; | ||||||
|     u_int32_t len, net_len; |     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); |     status = krb5_auth_con_init (context, &auth_context); | ||||||
|     if (status) |     if (status) | ||||||
| 	krb5_err (context, 1, status, "krb5_auth_con_init"); | 	krb5_err (context, 1, status, "krb5_auth_con_init"); | ||||||
| @@ -170,8 +166,10 @@ doit (const char *hostname, int port, const char *service) | |||||||
| 	    close (s); | 	    close (s); | ||||||
| 	    continue; | 	    continue; | ||||||
| 	} | 	} | ||||||
|  | 	freehostent (hostent); | ||||||
| 	return proto (s, hostname, service); | 	return proto (s, hostname, service); | ||||||
|     } |     } | ||||||
|  |     freehostent (hostent); | ||||||
|     return 1; |     return 1; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund