[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.2.5] Remove needless strdup in addressmap_register_virtual_address()



commit f2fb85f9707a37b15d790386e0283f53d640b16b
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Jan 13 12:24:42 2015 -0500

    Remove needless strdup in addressmap_register_virtual_address()
    
    Fixes bug 14195. Bugfix on 0.1.0.1-rc.
---
 changes/bug14195    |    3 +++
 src/or/addressmap.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/changes/bug14195 b/changes/bug14195
new file mode 100644
index 0000000..d2b82f3
--- /dev/null
+++ b/changes/bug14195
@@ -0,0 +1,3 @@
+  o Minor bugfixes (client):
+    - Fix a memory leak when using AutomapHostsOnResolve.
+      Fixes bug 14195; bugfix on 0.1.0.1-rc.
diff --git a/src/or/addressmap.c b/src/or/addressmap.c
index 4253532..d4b7acf 100644
--- a/src/or/addressmap.c
+++ b/src/or/addressmap.c
@@ -951,7 +951,7 @@ addressmap_register_virtual_address(int type, char *new_address)
         !strcasecmp(new_address, ent->new_address)) {
       tor_free(new_address);
       tor_assert(!vent_needs_to_be_added);
-      return tor_strdup(*addrp);
+      return *addrp;
     } else {
       log_warn(LD_BUG,
                "Internal confusion: I thought that '%s' was mapped to by "

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits