[tor-commits] [tor/master] Don't leak an extend_info_t in rend_client_any_intro_points_usable

nickm at torproject.org nickm at torproject.org
Mon Nov 7 16:45:31 UTC 2011


commit 65a0d7e7ef03cc2390cad81264e451e59206842b
Author: Robert Ransom <rransom.8774 at gmail.com>
Date:   Mon Nov 7 08:35:51 2011 -0800

    Don't leak an extend_info_t in rend_client_any_intro_points_usable
---
 changes/bug4424     |    6 ++++++
 src/or/rendclient.c |   10 ++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/changes/bug4424 b/changes/bug4424
new file mode 100644
index 0000000..6928745
--- /dev/null
+++ b/changes/bug4424
@@ -0,0 +1,6 @@
+  o Major bugfixes
+
+    - Don't leak memory when we check whether a hidden service
+      descriptor has any usable introduction points left.  Fixes bug
+      4424.  Bugfix on 0.2.2.25-alpha; found by frosty_un.
+
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index f84475a..3dfca58 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -952,8 +952,14 @@ rend_client_get_random_intro_impl(const rend_cache_entry_t *entry,
 int
 rend_client_any_intro_points_usable(const rend_cache_entry_t *entry)
 {
-  return rend_client_get_random_intro_impl(
-          entry, get_options()->StrictNodes, 0) != NULL;
+  extend_info_t *extend_info =
+    rend_client_get_random_intro_impl(entry, get_options()->StrictNodes, 0);
+  int rv = extend_info != NULL;
+
+  if (extend_info != NULL)
+    extend_info_free(extend_info);
+
+  return rv;
 }
 
 /** Client-side authorizations for hidden services; map of onion address to





More information about the tor-commits mailing list