]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Use xmalloc rather than xstrdup.
authorBenno Rice <benno@squid-cache.org>
Tue, 2 Sep 2008 09:57:18 +0000 (19:57 +1000)
committerBenno Rice <benno@squid-cache.org>
Tue, 2 Sep 2008 09:57:18 +0000 (19:57 +1000)
src/url.cc

index a9c4aa6b1487bdb0ba5f1d1684c9abcdf249074d..9fb514047a305f97f9c6a48bc6d87a02ef654120 100644 (file)
@@ -535,7 +535,7 @@ urlCanonicalClean(const HttpRequest * request)
 const char *
 urlAbsolute(const HttpRequest * req, const char *relUrl)
 {
-    char urlbuf[MAX_URL];
+    char *urlbuf;
     const char *path, *last_slash;
     size_t urllen, pathlen;
 
@@ -548,6 +548,7 @@ urlAbsolute(const HttpRequest * req, const char *relUrl)
     if (strchr(relUrl, ':') != NULL) {
         return (NULL);
     }
+    urlbuf = (char *)xmalloc(MAX_URL * sizeof(char));
     if (req->protocol == PROTO_URN) {
         snprintf(urlbuf, MAX_URL, "urn:%s", req->urlpath.buf());
     } else {
@@ -591,7 +592,7 @@ urlAbsolute(const HttpRequest * req, const char *relUrl)
        }
     }
 
-    return (xstrdup(urlbuf));
+    return (urlbuf);
 }
 
 /*