Cleaner fix part 1
[bluesky.git] / bluesky / store-simple.c
index 1b12ab6..ad93a05 100644 (file)
@@ -249,7 +249,7 @@ static gpointer simplestore_new(const gchar *path)
 
     /* TODO: Right now we leak this memory.  We should probably clean up in
      * simplestore_destroy, but it's not a big deal. */
-    const gchar *host = "127.0.0.1", *port = "8257";
+    const gchar *host = "127.0.0.1", *port = "9541";
     if (path != NULL) {
         gchar **target = g_strsplit(path, ":", 0);
         if (target[0] != NULL) {
@@ -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();