@@ -62,7 +62,7 @@ int create_server(const char* port, int* listen_fd)
62
62
assert (listen_fd != NULL );
63
63
64
64
struct addrinfo hints ;
65
- struct addrinfo * * result = NULL ;
65
+ struct addrinfo * result = NULL ;
66
66
// getaddrinfo
67
67
memset (& hints , 0 , sizeof (hints ));
68
68
hints .ai_family = AF_UNSPEC ; /* Allow IPv4 or IPv6 */
@@ -73,7 +73,7 @@ int create_server(const char* port, int* listen_fd)
73
73
hints .ai_addr = NULL ;
74
74
hints .ai_next = NULL ;
75
75
76
- int s = getaddrinfo (NULL , port , & hints , result );
76
+ int s = getaddrinfo (NULL , port , & hints , & result );
77
77
if (s != 0 ) {
78
78
fprintf (stderr , "getaddrinfo: %s\n" , gai_strerror (s ));
79
79
return -1 ;
@@ -82,7 +82,7 @@ int create_server(const char* port, int* listen_fd)
82
82
int fd ;
83
83
struct addrinfo * rp ;
84
84
log_trace ("main: passed getaddrinfo" );
85
- for (rp = * result ; rp != NULL ; rp = rp -> ai_next ) {
85
+ for (rp = result ; rp != NULL ; rp = rp -> ai_next ) {
86
86
fd = socket (rp -> ai_family , rp -> ai_socktype , rp -> ai_protocol );
87
87
if (fd == -1 )
88
88
continue ;
@@ -95,7 +95,7 @@ int create_server(const char* port, int* listen_fd)
95
95
close (fd );
96
96
}
97
97
98
- freeaddrinfo (* result ); /* No longer needed */
98
+ freeaddrinfo (result ); /* No longer needed */
99
99
log_trace ("main: freeaddrinfo" );
100
100
101
101
if (rp == NULL ) { /* No address succeeded */
0 commit comments