summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-09-05 20:54:52 +0000
committerNick Mathewson <nickm@torproject.org>2008-09-05 20:54:52 +0000
commit066104e85353bd6eb11ba615b2dd03a2ace190a8 (patch)
tree4381c30bd876f62fd5aa0d447ab5f03db428b290
parentcbadc6efe37bf3838ad3d67b819a6cf4470dfde7 (diff)
downloadtor-066104e85353bd6eb11ba615b2dd03a2ace190a8.tar.gz
tor-066104e85353bd6eb11ba615b2dd03a2ace190a8.zip
Backport: Fix numerous memory leaks: some were almost impossible to trigger, and some almost inevitable.
svn:r16781
-rw-r--r--src/or/connection_edge.c2
-rw-r--r--src/or/directory.c2
-rw-r--r--src/or/rendcommon.c1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 0197d05c31..b42dadf49c 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -696,6 +696,8 @@ clear_trackexithost_mappings(const char *exitname)
MAP_DEL_CURRENT(address);
}
} STRMAP_FOREACH_END;
+
+ tor_free(suffix);
}
/** Remove all entries from the addressmap that were set via the
diff --git a/src/or/directory.c b/src/or/directory.c
index 6e2ccb605f..9cdf4606ac 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2806,7 +2806,7 @@ directory_handle_command_post(dir_connection_t *conn, const char *headers,
* 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) &&
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index e7ac4a1f0f..dd91d4c402 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -884,6 +884,7 @@ rend_cache_store(const char *desc, size_t desc_len, int published)
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 */