]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Correctly duplicate addresses in get_interface_address6_list
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>
Fri, 4 Mar 2016 17:42:27 +0000 (18:42 +0100)
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>
Fri, 4 Mar 2016 17:42:27 +0000 (18:42 +0100)
src/common/address.c

index c77b0f3c943a6cfd746155cd5826fb9872bb01e5..793a40effc2c6774cc1333bf2aed0a6a65a5866e 100644 (file)
@@ -1790,7 +1790,7 @@ MOCK_IMPL(smartlist_t *,get_interface_address6_list,(int severity,
     if (get_interface_address6_via_udp_socket_hack(severity,AF_INET,
                                                    &addr) == 0) {
       if (include_internal || !tor_addr_is_internal(&addr, 0)) {
-        smartlist_add(addrs, tor_dup_addr(&addr));
+        smartlist_add(addrs, tor_memdup(&addr, sizeof(addr)));
       }
     }
   }
@@ -1799,7 +1799,7 @@ MOCK_IMPL(smartlist_t *,get_interface_address6_list,(int severity,
     if (get_interface_address6_via_udp_socket_hack(severity,AF_INET6,
                                                    &addr) == 0) {
       if (include_internal || !tor_addr_is_internal(&addr, 0)) {
-        smartlist_add(addrs, tor_dup_addr(&addr));
+        smartlist_add(addrs, tor_memdup(&addr, sizeof(addr)));
       }
     }
   }