From: Amos Jeffries Date: Thu, 23 Feb 2017 11:18:39 +0000 (+1300) Subject: Add missing return statements after self_destruct() in WCCP X-Git-Tag: M-staged-PR71~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=337eb4760a338c2e74b0997976ce316120d42966;p=thirdparty%2Fsquid.git Add missing return statements after self_destruct() in WCCP Detected by Coverity Scan. Issues 1364712, 1364713, 1364718. --- diff --git a/src/wccp2.cc b/src/wccp2.cc index b41744a9f6..23eabbfc14 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -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 */