commit 78572dd0e779b092461302ceed5540c76c08de2b
parent 68b01264fd70ed0a459c31d2cd4d266412383189
Author: sin <sin@2f30.org>
Date: Mon, 4 Jun 2012 14:51:51 +0100
sscall: Free address info as early as possible
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sscall.c b/sscall.c
@@ -261,6 +261,8 @@ 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;
@@ -288,6 +290,8 @@ 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);
@@ -321,9 +325,6 @@ main(int argc, char *argv[])
do_output_pcm(buf, bytes);
} while (1);
- freeaddrinfo(cli_servinfo);
- freeaddrinfo(srv_servinfo);
-
ao_close(device);
ao_shutdown();