[tor-commits] [tor/master] Fix a memory leak in router_parse_addr_policy_item_from_string. CID 1324770

nickm at torproject.org nickm at torproject.org
Tue Sep 22 13:55:28 UTC 2015


commit 6b6a714732e1bec58ee92b535902a5bbc5c7e946
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Sep 22 09:55:05 2015 -0400

    Fix a memory leak in router_parse_addr_policy_item_from_string.  CID 1324770
---
 src/or/routerparse.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 17c46ac..f898ef8 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -3744,7 +3744,9 @@ router_parse_addr_policy_item_from_string,(const char *s, int assume_action,
              "exit policy. Ignoring, but continuing to parse rules. (Use "
              "accept/reject with IPv4 addresses.)",
              tok->n_args == 1 ? tok->args[0] : "");
-    return NULL;
+    addr_policy_free(r);
+    r = NULL;
+    goto done;
   }
 
   goto done;



More information about the tor-commits mailing list