@@ -62,7 +62,7 @@ int create_server(const char* port, int* listen_fd)
6262 assert (listen_fd != NULL );
6363
6464 struct addrinfo hints ;
65- struct addrinfo * * result = NULL ;
65+ struct addrinfo * result = NULL ;
6666 // getaddrinfo
6767 memset (& hints , 0 , sizeof (hints ));
6868 hints .ai_family = AF_UNSPEC ; /* Allow IPv4 or IPv6 */
@@ -73,7 +73,7 @@ int create_server(const char* port, int* listen_fd)
7373 hints .ai_addr = NULL ;
7474 hints .ai_next = NULL ;
7575
76- int s = getaddrinfo (NULL , port , & hints , result );
76+ int s = getaddrinfo (NULL , port , & hints , & result );
7777 if (s != 0 ) {
7878 fprintf (stderr , "getaddrinfo: %s\n" , gai_strerror (s ));
7979 return -1 ;
@@ -82,7 +82,7 @@ int create_server(const char* port, int* listen_fd)
8282 int fd ;
8383 struct addrinfo * rp ;
8484 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 ) {
8686 fd = socket (rp -> ai_family , rp -> ai_socktype , rp -> ai_protocol );
8787 if (fd == -1 )
8888 continue ;
@@ -95,7 +95,7 @@ int create_server(const char* port, int* listen_fd)
9595 close (fd );
9696 }
9797
98- freeaddrinfo (* result ); /* No longer needed */
98+ freeaddrinfo (result ); /* No longer needed */
9999 log_trace ("main: freeaddrinfo" );
100100
101101 if (rp == NULL ) { /* No address succeeded */
0 commit comments