summaryrefslogtreecommitdiffstats
path: root/modules/proxy
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/proxy/proxy_util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
index 1597b9f211..59b77aa7c3 100644
--- a/modules/proxy/proxy_util.c
+++ b/modules/proxy/proxy_util.c
@@ -1951,12 +1951,12 @@ PROXY_DECLARE(char *) ap_proxy_define_match_worker(apr_pool_t *p,
int do_malloc)
{
char *err;
- char *rurl = apr_pstrdup(p, url);
- char *pdollar = ap_strchr(rurl, '$');
+ const char *pdollar = ap_strchr_c(url, '$');
- if (pdollar != NULL)
- *pdollar = '\0';
- err = ap_proxy_define_worker(p, worker, balancer, conf, rurl, do_malloc);
+ if (pdollar != NULL) {
+ url = apr_pstrmemdup(p, url, pdollar - url);
+ }
+ err = ap_proxy_define_worker(p, worker, balancer, conf, url, do_malloc);
if (err) {
return err;
}