commit dbc347a91ad68bb40250a5f383bcd63d359268a0
parent 62a114524176823681f08c88ef77db532672953b
Author: sin <sin@2f30.org>
Date: Mon, 4 Jun 2012 19:37:47 +0100
sscall: Don't free address info as it is used by sendto()
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/sscall.c b/sscall.c
@@ -324,8 +324,6 @@ main(int argc, char *argv[])
if (!p0)
errx(1, "failed to bind socket");
- freeaddrinfo(cli_servinfo);
-
memset(&srv_hints, 0, sizeof(srv_hints));
srv_hints.ai_family = AF_INET;
srv_hints.ai_socktype = SOCK_DGRAM;
@@ -351,8 +349,6 @@ main(int argc, char *argv[])
if (!p1)
errx(1, "failed to bind socket");
- freeaddrinfo(srv_servinfo);
-
INIT_LIST_HEAD(&pcm_buf.list);
pthread_mutex_init(&pcm_buf_lock, NULL);
@@ -436,5 +432,8 @@ main(int argc, char *argv[])
ao_close(device);
ao_shutdown();
+ freeaddrinfo(cli_servinfo);
+ freeaddrinfo(srv_servinfo);
+
return EXIT_SUCCESS;
}