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

[tor-commits] [tor/master] Fix a memory leak in tor-resolve.c



commit cdafcc49bc273e472d40ea8c01219bbc165c92cb
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Apr 11 19:09:23 2019 -0400

    Fix a memory leak in tor-resolve.c
    
    Closes bug 30151/coverity CID 1441830. Bugfix on 0.4.0.1-alpha when
    we started doing trunnel parsing in tor-resolve.c.
---
 changes/bug30151        | 5 +++++
 src/tools/tor-resolve.c | 1 +
 2 files changed, 6 insertions(+)

diff --git a/changes/bug30151 b/changes/bug30151
new file mode 100644
index 000000000..8ac9a320a
--- /dev/null
+++ b/changes/bug30151
@@ -0,0 +1,5 @@
+  o Minor bugfixes (tor-resolve):
+    - Fix a memory leak in tor-resolve that could happen if Tor gave it a
+      malformed SOCKS response.  (Memory leaks in tor-resolve don't actually
+      matter, but it's good to fix them anyway.)  Fixes bug 30151; bugfix on
+      0.4.0.1-alpha.
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 98b3a4a74..5d97696c1 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -424,6 +424,7 @@ do_resolve(const char *hostname,
     if (parsed < 2) {
       log_err(LD_NET, "Failed to parse SOCKS5 method selection "
                       "message");
+      socks5_server_method_free(m);
       goto err;
     }
 



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