From eab4ae000b82fdb54b5c3d1771e03d1cca6dada1 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Fri, 2 Oct 2009 15:27:43 +0530 Subject: url variable modified in do_transparent_proxy() is not the url variable in the caller --- src/transparent-proxy.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/transparent-proxy.c b/src/transparent-proxy.c index 907f51d..8144e42 100644 --- a/src/transparent-proxy.c +++ b/src/transparent-proxy.c @@ -86,7 +86,9 @@ do_transparent_proxy (struct conn_s *connptr, hashmap_t hashofheaders, request->path = (char *) safemalloc (ulen + 1); strlcpy (request->path, url, ulen + 1); - safefree (url); + /* url overwritten by the call below is the url passed + * to this function, and is not the url variable in the + * caller. */ build_url (&url, request->host, request->port, request->path); log_message (LOG_INFO, "process_request: trans IP %s %s for %d", @@ -102,7 +104,9 @@ do_transparent_proxy (struct conn_s *connptr, hashmap_t hashofheaders, request->path = (char *) safemalloc (ulen + 1); strlcpy (request->path, url, ulen + 1); - safefree (url); + /* url overwritten by the call below is the url passed + * to this function, and is not the url variable in the + * caller. */ build_url (&url, request->host, request->port, request->path); log_message (LOG_INFO, "process_request: trans Host %s %s for %d", -- cgit v1.2.3