Fix memory leak in connection_ap_handshake_rewrite_and_attach()

Spotted by asn.  #14259.  Bugfix on 368eb6a97 in 0.2.0.1-alpha.
This commit is contained in:
Nick Mathewson 2015-01-18 14:19:26 -05:00
parent b72acd725a
commit 54e4aaf52c
2 changed files with 7 additions and 0 deletions

6
changes/bug14259 Normal file
View File

@ -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.

View File

@ -1001,6 +1001,7 @@ connection_ap_handshake_rewrite(entry_connection_t *conn,
strlen(result), (uint8_t*)result, strlen(result), (uint8_t*)result,
-1, -1,
out->map_expires); out->map_expires);
tor_free(result);
out->end_reason = END_STREAM_REASON_DONE | out->end_reason = END_STREAM_REASON_DONE |
END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED; END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED;
out->should_close = 1; out->should_close = 1;