Fix a bug in the socket opening code
authorPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 2 Jun 2010 20:14:07 +0000 (22:14 +0200)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 2 Jun 2010 20:22:00 +0000 (22:22 +0200)
This issue was reported here:
http://talk.maemo.org/showthread.php?t=41373&highlight=Tor&page=5#postcount693326

src/torcontrol-socket.c

index a8002d0..1d95bd2 100644 (file)
@@ -54,12 +54,12 @@ int tor_control_open_socket (int port, GError **error) {
        }
 
        for (rp = result; rp != NULL; rp = rp->ai_next) {
-               sockfd = socket (result->ai_family, result->ai_socktype,
-                                result->ai_protocol);
+               sockfd = socket (rp->ai_family, rp->ai_socktype,
+                                rp->ai_protocol);
                if (sockfd == -1)
                        continue;
 
-               status = connect (sockfd, result->ai_addr, result->ai_addrlen);
+               status = connect (sockfd, rp->ai_addr, rp->ai_addrlen);
                if (status != -1)
                        break;