]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
cachemgr.cgi: memory leak in request parser
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 Jan 2015 10:32:57 +0000 (02:32 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 Jan 2015 10:32:57 +0000 (02:32 -0800)
Leaks a block of memory for each header parsed the size of the header.

The CGI is rarely operating for long periods, it is run as-needed by
servers so the memory leak does not accumulate long term.

  Detectd by Coverity Scan. Issue 1256164

tools/cachemgr.cc

index 63515a7f9a5c8c78617545afbd3b3fb1d7ef8f89..d05dc63dce9505cac805efd7f4f8e0e3ff5a3d71 100644 (file)
@@ -1072,6 +1072,7 @@ read_request(void)
             req->workers = xstrdup(q);
         else if (0 == strcmp(t, "processes") && strlen(q))
             req->processes = xstrdup(q);
+        safe_free(t);
     }
 
     if (req->server && !req->hostname) {