aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-18 14:19:26 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-18 14:19:26 -0500
commit54e4aaf52c882626fe2cce0ba704d9661269ab99 (patch)
tree829f9153bdd07313c8f7ee33ca79cf921cdc84fb
parentb72acd725aa687bae7012abcc0d67aef9d32bfaa (diff)
downloadtor-54e4aaf52c882626fe2cce0ba704d9661269ab99.tar.gz
tor-54e4aaf52c882626fe2cce0ba704d9661269ab99.zip
Fix memory leak in connection_ap_handshake_rewrite_and_attach()
Spotted by asn. #14259. Bugfix on 368eb6a97 in 0.2.0.1-alpha.
-rw-r--r--changes/bug142596
-rw-r--r--src/or/connection_edge.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/changes/bug14259 b/changes/bug14259
new file mode 100644
index 0000000000..1b5b9b80b3
--- /dev/null
+++ b/changes/bug14259
@@ -0,0 +1,6 @@
+ o Minor bugfixes (client):
+ - Avoid a small memory leak when we find a cached answer for a reverse
+ DNS lookup in a client-side DNS cache. (Remember, client-side DNS
+ caching is off by default, and is not recommended.) Fixes bug 14259;
+ bugfix on 0.2.0.1-alpha.
+
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 7a77f5e20a..7dc8f9c878 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1001,6 +1001,7 @@ connection_ap_handshake_rewrite(entry_connection_t *conn,
strlen(result), (uint8_t*)result,
-1,
out->map_expires);
+ tor_free(result);
out->end_reason = END_STREAM_REASON_DONE |
END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED;
out->should_close = 1;