]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
cachemgr.cgi: memory leak in request parser
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Jan 2015 23:06:40 +0000 (15:06 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Jan 2015 23:06:40 +0000 (15:06 -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 fbbd433bfa7fe0e677be2eea7515538c7c182a3b..6a2aee63876b08707a026ed323b1eb087f63bf51 100644 (file)
@@ -1035,6 +1035,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) {