From: Jim Jagielski <jim@apache.org>
Date: Tue, 15 Oct 2013 20:02:30 +0000 (+0000)
Subject: don't use what could have been freed...
X-Git-Tag: 2.5.0-alpha~4937
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a00a928dd25d70cba30a12f566757fdeacf9d750;p=apache

don't use what could have been freed...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1532507 13f79535-47bb-0310-9956-ffa450edef68
---

diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
index 8b04c20c32..3faf2ff479 100644
--- a/modules/proxy/proxy_util.c
+++ b/modules/proxy/proxy_util.c
@@ -1218,11 +1218,11 @@ PROXY_DECLARE(apr_status_t) ap_proxy_share_balancer(proxy_balancer *balancer,
     } else {
         action = "re-using";
     }
+    balancer->s = shm;
+    balancer->s->index = i;
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02337)
                  "%s shm[%d] (0x%pp) for %s", action, i, (void *)shm,
                  balancer->s->name);
-    balancer->s = shm;
-    balancer->s->index = i;
     /* the below should always succeed */
     lbmethod = ap_lookup_provider(PROXY_LBMETHOD, balancer->s->lbpname, "0");
     if (lbmethod) {
@@ -1731,12 +1731,11 @@ PROXY_DECLARE(apr_status_t) ap_proxy_share_worker(proxy_worker *worker, proxy_wo
     } else {
         action = "re-using";
     }
+    worker->s = shm;
+    worker->s->index = i;
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02338)
                  "%s shm[%d] (0x%pp) for worker: %s", action, i, (void *)shm,
                  ap_proxy_worker_name(NULL, worker));
-
-    worker->s = shm;
-    worker->s->index = i;
     return APR_SUCCESS;
 }