From: Michael Vrable Date: Wed, 2 Feb 2011 17:30:47 +0000 (-0800) Subject: Fix use-after-free in network address lookups. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=fd34d77b255eb3a65f5a0f6fa76681ac8ed272b6;p=bluesky.git Fix use-after-free in network address lookups. --- diff --git a/bluesky/store-simple.c b/bluesky/store-simple.c index fdd5139..ad93a05 100644 --- a/bluesky/store-simple.c +++ b/bluesky/store-simple.c @@ -273,7 +273,6 @@ static gpointer simplestore_new(const gchar *path) gai_strerror(res)); return NULL; } - freeaddrinfo(lookup_result); for (struct addrinfo *ai = lookup_result; ai != NULL; ai = ai->ai_next) { printf("flags=%d family=%d socktype=%d proto=%d\n", ai->ai_flags, @@ -287,6 +286,7 @@ static gpointer simplestore_new(const gchar *path) fprintf(stderr, "Warning: Bad address record size!\n"); } } + freeaddrinfo(lookup_result); store->fd_pool = g_queue_new(); store->fd_pool_lock = g_mutex_new();