]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
squidclient: Fix incorrect use of delete on GSSAPI tokens
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Jan 2015 22:56:44 +0000 (14:56 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Jan 2015 22:56:44 +0000 (14:56 -0800)
  Detected by Coverity Scan. Issue 1261432

tools/squidclient/squidclient.cc

index d2c49afdaf4a5b798c7650f3cdf70d484594e8ff..245ecec0bc9a80e71df227dbed97c01debe498f9 100644 (file)
@@ -462,7 +462,7 @@ main(int argc, char *argv[])
                 const char *token = GSSAPI_token(host);
                 snprintf(buf, BUFSIZ, "Authorization: Negotiate %s\r\n", token);
                 strcat(msg, buf);
-                delete token;
+                delete[] token;
             } else
                 std::cerr << "ERROR: server host missing" << std::endl;
         }
@@ -471,7 +471,7 @@ main(int argc, char *argv[])
                 const char *token = GSSAPI_token(Transport::Config.hostname);
                 snprintf(buf, BUFSIZ, "Proxy-Authorization: Negotiate %s\r\n", token);
                 strcat(msg, buf);
-                delete token;
+                delete[] token;
             } else
                 std::cerr << "ERROR: proxy server host missing" << std::endl;
         }