You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2017/05/13 00:14:47 UTC

[trafficserver] branch master updated: coverity 1021714: Uninitialized pointer field

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  bd602e3   coverity 1021714: Uninitialized pointer field
bd602e3 is described below

commit bd602e3d64bfdb254275b85012cef525cf4e49ce
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu May 11 17:31:29 2017 -0400

    coverity 1021714: Uninitialized pointer field
---
 proxy/ParentSelection.h | 45 ++++++++++++++-------------------------------
 1 file changed, 14 insertions(+), 31 deletions(-)

diff --git a/proxy/ParentSelection.h b/proxy/ParentSelection.h
index 10686a8..8be33d9 100644
--- a/proxy/ParentSelection.h
+++ b/proxy/ParentSelection.h
@@ -114,33 +114,16 @@ typedef ControlMatcher<ParentRecord, ParentResult> P_table;
 class ParentRecord : public ControlBase
 {
 public:
-  ParentRecord()
-    : parents(NULL),
-      secondary_parents(NULL),
-      num_parents(0),
-      num_secondary_parents(0),
-      ignore_query(false),
-      rr_next(0),
-      go_direct(true),
-      parent_is_proxy(true),
-      selection_strategy(NULL),
-      unavailable_server_retry_responses(NULL),
-      parent_retry(PARENT_RETRY_NONE),
-      max_simple_retries(1),
-      max_unavailable_server_retries(1)
-  {
-  }
-
   ~ParentRecord();
 
   Result Init(matcher_line *line_info);
   bool DefaultInit(char *val);
   void UpdateMatch(ParentResult *result, RequestData *rdata);
   void Print();
-  pRecord *parents;
-  pRecord *secondary_parents;
-  int num_parents;
-  int num_secondary_parents;
+  pRecord *parents           = nullptr;
+  pRecord *secondary_parents = nullptr;
+  int num_parents            = 0;
+  int num_secondary_parents  = 0;
 
   bool
   bypass_ok() const
@@ -148,18 +131,18 @@ public:
     return go_direct;
   }
 
-  const char *scheme;
+  const char *scheme = nullptr;
   // private:
   const char *ProcessParents(char *val, bool isPrimary);
-  bool ignore_query;
-  volatile uint32_t rr_next;
-  bool go_direct;
-  bool parent_is_proxy;
-  ParentSelectionStrategy *selection_strategy;
-  UnavailableServerResponseCodes *unavailable_server_retry_responses;
-  ParentRetry_t parent_retry;
-  int max_simple_retries;
-  int max_unavailable_server_retries;
+  bool ignore_query                                                  = false;
+  volatile uint32_t rr_next                                          = 0;
+  bool go_direct                                                     = true;
+  bool parent_is_proxy                                               = true;
+  ParentSelectionStrategy *selection_strategy                        = nullptr;
+  UnavailableServerResponseCodes *unavailable_server_retry_responses = nullptr;
+  ParentRetry_t parent_retry                                         = PARENT_RETRY_NONE;
+  int max_simple_retries                                             = 1;
+  int max_unavailable_server_retries                                 = 1;
 };
 
 // If the parent was set by the external customer api,

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].