[tor-commits] [tor/master] Fix a small memory leak when resolving PTR addresses

nickm at torproject.org nickm at torproject.org
Wed Apr 9 00:30:49 UTC 2014


commit ab1a679eef77520f072e9933ae125dfcf0c228cf
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Apr 7 23:29:47 2014 -0400

    Fix a small memory leak when resolving PTR addresses
    
    Fixes bug 11437; bugfix on 0.2.4.7-alpha.
    
    Found by coverity; this is CID 1198198.
---
 changes/bug11437 |    3 +++
 src/or/dns.c     |    1 +
 2 files changed, 4 insertions(+)

diff --git a/changes/bug11437 b/changes/bug11437
new file mode 100644
index 0000000..f5117ca
--- /dev/null
+++ b/changes/bug11437
@@ -0,0 +1,3 @@
+  o Minor bugfixes:
+    - Stop leaking memory when we successfully resolve a PTR record.
+      Fixes bug 11437; bugfix on 0.2.4.7-alpha.
diff --git a/src/or/dns.c b/src/or/dns.c
index f2b7eec..fb1b10d 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -1352,6 +1352,7 @@ inform_pending_connections(cached_resolve_t *resolve)
     }
     resolve->pending_connections = pend->next;
     tor_free(pend);
+    tor_free(hostname);
   }
 }
 





More information about the tor-commits mailing list