]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add missing return statements after self_destruct() in WCCP
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 23 Feb 2017 11:18:39 +0000 (00:18 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 23 Feb 2017 11:18:39 +0000 (00:18 +1300)
 Detected by Coverity Scan. Issues 136471213647131364718.

src/wccp2.cc

index b41744a9f6889d23922d9d5debcaa13fabf5bf9b..23eabbfc14d10ba0d9cffed993d22eb7040850b0 100644 (file)
@@ -2002,6 +2002,7 @@ parse_wccp2_method(int *method)
     if ((t = ConfigParser::NextToken()) == NULL) {
         debugs(80, DBG_CRITICAL, "wccp2_*_method: missing setting.");
         self_destruct();
+        return;
     }
 
     /* update configuration if its valid */
@@ -2049,6 +2050,7 @@ parse_wccp2_amethod(int *method)
     if ((t = ConfigParser::NextToken()) == NULL) {
         debugs(80, DBG_CRITICAL, "wccp2_assignment_method: missing setting.");
         self_destruct();
+        return;
     }
 
     /* update configuration if its valid */
@@ -2105,6 +2107,7 @@ parse_wccp2_service(void *)
     if ((t = ConfigParser::NextToken()) == NULL) {
         debugs(80, DBG_CRITICAL, "wccp2ParseServiceInfo: missing service info type (standard|dynamic)");
         self_destruct();
+        return;
     }
 
     if (strcmp(t, "standard") == 0) {
@@ -2114,6 +2117,7 @@ parse_wccp2_service(void *)
     } else {
         debugs(80, DBG_CRITICAL, "wccp2ParseServiceInfo: bad service info type (expected standard|dynamic, got " << t << ")");
         self_destruct();
+        return;
     }
 
     /* Snarf the ID */
@@ -2122,6 +2126,7 @@ parse_wccp2_service(void *)
     if (service_id < 0 || service_id > 255) {
         debugs(80, DBG_CRITICAL, "ERROR: invalid WCCP service id " << service_id << " (must be between 0 .. 255)");
         self_destruct();
+        return;
     }
 
     memset(wccp_password, 0, sizeof(wccp_password));
@@ -2289,6 +2294,7 @@ parse_wccp2_service_info(void *)
     if (service_id < 0 || service_id > 255) {
         debugs(80, DBG_CRITICAL, "ERROR: invalid WCCP service id " << service_id << " (must be between 0 .. 255)");
         self_destruct();
+        return;
     }
 
     /* Next: find the (hopefully!) existing service */