[or-cvs] r16781: {tor} Backport: Fix numerous memory leaks: some were almost imposs (tor/branches/tor-0_2_0-patches/src/or)

nickm at seul.org nickm at seul.org
Fri Sep 5 20:54:53 UTC 2008


Author: nickm
Date: 2008-09-05 16:54:52 -0400 (Fri, 05 Sep 2008)
New Revision: 16781

Modified:
   tor/branches/tor-0_2_0-patches/src/or/connection_edge.c
   tor/branches/tor-0_2_0-patches/src/or/directory.c
   tor/branches/tor-0_2_0-patches/src/or/rendcommon.c
Log:
Backport: Fix numerous memory leaks: some were almost impossible to trigger, and some almost inevitable.

Modified: tor/branches/tor-0_2_0-patches/src/or/connection_edge.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/connection_edge.c	2008-09-05 20:53:39 UTC (rev 16780)
+++ tor/branches/tor-0_2_0-patches/src/or/connection_edge.c	2008-09-05 20:54:52 UTC (rev 16781)
@@ -696,6 +696,8 @@
       MAP_DEL_CURRENT(address);
     }
   } STRMAP_FOREACH_END;
+
+  tor_free(suffix);
 }
 
 /** Remove all entries from the addressmap that were set via the

Modified: tor/branches/tor-0_2_0-patches/src/or/directory.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/directory.c	2008-09-05 20:53:39 UTC (rev 16780)
+++ tor/branches/tor-0_2_0-patches/src/or/directory.c	2008-09-05 20:54:52 UTC (rev 16781)
@@ -2806,7 +2806,7 @@
      * receive anything. */
     write_http_status_line(conn, 400, "Nonauthoritative directory does not "
                            "accept posted server descriptors");
-    return 0;
+    goto done;
   }
 
   if (authdir_mode_handles_descs(options, -1) &&

Modified: tor/branches/tor-0_2_0-patches/src/or/rendcommon.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/rendcommon.c	2008-09-05 20:53:39 UTC (rev 16780)
+++ tor/branches/tor-0_2_0-patches/src/or/rendcommon.c	2008-09-05 20:54:52 UTC (rev 16781)
@@ -884,6 +884,7 @@
   if (!published && strmap_get_lc(rend_cache, key)) {
     log_info(LD_REND, "We already have a v2 descriptor for service %s.",
              safe_str(query));
+    rend_service_descriptor_free(parsed);
     return -1;
   }
   /* report novel publication to statistics */



More information about the tor-commits mailing list