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/10 12:51:45 UTC

[trafficserver] branch master updated: coverity 1021753: 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  41d7c59   coverity 1021753: Uninitialized pointer field
41d7c59 is described below

commit 41d7c5993e73bc21ebce7985c09d3c0fa2ad5dcc
Author: Bryan Call <bc...@apache.org>
AuthorDate: Tue May 9 22:39:08 2017 -0400

    coverity 1021753: Uninitialized pointer field
---
 iocore/eventsystem/I_Event.h     | 10 +++++-----
 iocore/eventsystem/P_UnixEvent.h | 10 +---------
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/iocore/eventsystem/I_Event.h b/iocore/eventsystem/I_Event.h
index 368e7e8..344548e 100644
--- a/iocore/eventsystem/I_Event.h
+++ b/iocore/eventsystem/I_Event.h
@@ -203,17 +203,17 @@ public:
 
   void free();
 
-  EThread *ethread;
+  EThread *ethread = nullptr;
 
   unsigned int in_the_prot_queue : 1;
   unsigned int in_the_priority_queue : 1;
   unsigned int immediate : 1;
   unsigned int globally_allocated : 1;
   unsigned int in_heap : 4;
-  int callback_event;
+  int callback_event = 0;
 
-  ink_hrtime timeout_at;
-  ink_hrtime period;
+  ink_hrtime timeout_at = 0;
+  ink_hrtime period     = 0;
 
   /**
     This field can be set when an event is created. It is returned
@@ -221,7 +221,7 @@ public:
     is called.
 
   */
-  void *cookie;
+  void *cookie = nullptr;
 
   // Private
 
diff --git a/iocore/eventsystem/P_UnixEvent.h b/iocore/eventsystem/P_UnixEvent.h
index 830defd..ae960db 100644
--- a/iocore/eventsystem/P_UnixEvent.h
+++ b/iocore/eventsystem/P_UnixEvent.h
@@ -43,15 +43,7 @@ Event::free()
 }
 
 TS_INLINE
-Event::Event()
-  : ethread(0),
-    in_the_prot_queue(false),
-    in_the_priority_queue(false),
-    immediate(false),
-    globally_allocated(true),
-    in_heap(false),
-    timeout_at(0),
-    period(0)
+Event::Event() : in_the_prot_queue(false), in_the_priority_queue(false), immediate(false), globally_allocated(true), in_heap(false)
 {
 }
 

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