From 88fb9f606860a1e26179280ebd045c9d488236f5 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Wed, 18 May 2016 21:46:42 +0000 Subject: [PATCH] Avoid memory allocation before making sure that this handler can handle the URL git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1744459 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy_scgi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/proxy/mod_proxy_scgi.c b/modules/proxy/mod_proxy_scgi.c index 224d1ef123..983f9ba28e 100644 --- a/modules/proxy/mod_proxy_scgi.c +++ b/modules/proxy/mod_proxy_scgi.c @@ -509,7 +509,7 @@ static int scgi_request_status(int *status, request_rec *r) *status = HTTP_INTERNAL_SERVER_ERROR; return *status; } - } while(0); + } while (0); return OK; /* break; */ @@ -530,7 +530,7 @@ static int scgi_handler(request_rec *r, proxy_worker *worker, int status; proxy_conn_rec *backend = NULL; apr_pool_t *p = r->pool; - apr_uri_t *uri = apr_palloc(r->pool, sizeof(*uri)); + apr_uri_t *uri; char dummy; if (ap_casecmpstrn(url, SCHEME "://", sizeof(SCHEME) + 2)) { @@ -548,6 +548,7 @@ static int scgi_handler(request_rec *r, proxy_worker *worker, backend->is_ssl = 0; /* Step One: Determine Who To Connect To */ + uri = apr_palloc(p, sizeof(*uri)); status = ap_proxy_determine_connection(p, r, conf, worker, backend, uri, &url, proxyname, proxyport, &dummy, 1); -- 2.40.0