summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-04-19 15:23:38 +0000
committerNick Mathewson <nickm@torproject.org>2007-04-19 15:23:38 +0000
commitbf4f0539cf1163c872574055fe69d67f06a5f87f (patch)
tree7b8f0f12a4d98faf08340e3a9961aaba38a65b64 /src
parentaddf2987c58b86aa98b1771200d724e514adb7cb (diff)
downloadtor-bf4f0539cf1163c872574055fe69d67f06a5f87f.tar.gz
tor-bf4f0539cf1163c872574055fe69d67f06a5f87f.zip
r12434@catbus: nickm | 2007-04-19 11:23:35 -0400
When advancing a string pointer, make sure we do not later free the altered pointer. Fixes bug 416, introduced in r9971. svn:r9990
Diffstat (limited to 'src')
-rw-r--r--src/or/directory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index e76108f9b2..2c1261bd32 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1685,6 +1685,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
if (!strcmpstart(url,"/tor/server/") ||
!strcmpstart(url,"/tor/extra/")) {
+ char *url_mem = url;
size_t url_len = strlen(url);
int deflated = !strcmp(url+url_len-2, ".z");
int res;
@@ -1724,7 +1725,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
else
conn->dir_spool_src =
is_extra ? DIR_SPOOL_EXTRA_BY_FP : DIR_SPOOL_SERVER_BY_FP;
- tor_free(url);
+ tor_free(url_mem);
if (res < 0)
write_http_status_line(conn, 404, msg);
else {