]> granicus.if.org Git - apache/commitdiff
use non-'const char *' while building string to avoid warnings
authorJeff Trawick <trawick@apache.org>
Wed, 9 Nov 2011 04:23:13 +0000 (04:23 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 9 Nov 2011 04:23:13 +0000 (04:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199611 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_authn_socache.c

index a11cf31617e4edbe600ec509b935e822d33a488e..317ce9f7bd3c3cd9d8f840077b30d1335152bd36 100644 (file)
@@ -231,11 +231,13 @@ static const char *construct_key(request_rec *r, const char *context,
     /* handle "special" context values */
     if (!strcmp(context, "directory")) {
         /* FIXME: are we at risk of this blowing up? */
+        char *new_context;
         char *slash = strrchr(r->uri, '/');
-        context = apr_palloc(r->pool, slash - r->uri +
-                                      strlen(r->server->server_hostname) + 1);
-        strcpy(context, r->server->server_hostname);
-        strncat(context, r->uri, slash - r->uri);
+        new_context = apr_palloc(r->pool, slash - r->uri +
+                                 strlen(r->server->server_hostname) + 1);
+        strcpy(new_context, r->server->server_hostname);
+        strncat(new_context, r->uri, slash - r->uri);
+        context = new_context;
     }
     else if (!strcmp(context, "server")) {
         context = r->server->server_hostname;