trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] branch master updated: coverity 1021760: Uninitialized scalar field
Date Wed, 10 May 2017 12:52:30 GMT
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  2802acf   coverity 1021760: Uninitialized scalar field
2802acf is described below

commit 2802acf847f8c34da278c566962ca8c22321e4cd
Author: Bryan Call <bcall@apache.org>
AuthorDate: Tue May 9 22:11:58 2017 -0400

    coverity 1021760: Uninitialized scalar field
---
 iocore/cache/RamCacheLRU.cc | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/iocore/cache/RamCacheLRU.cc b/iocore/cache/RamCacheLRU.cc
index 31c3d8e..6f883eb 100644
--- a/iocore/cache/RamCacheLRU.cc
+++ b/iocore/cache/RamCacheLRU.cc
@@ -35,9 +35,9 @@ struct RamCacheLRUEntry {
 #define ENTRY_OVERHEAD 128 // per-entry overhead to consider when computing sizes
 
 struct RamCacheLRU : public RamCache {
-  int64_t max_bytes;
-  int64_t bytes;
-  int64_t objects;
+  int64_t max_bytes = 0;
+  int64_t bytes = 0;
+  int64_t objects = 0;
 
   // returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must
match
   int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, uint32_t auxkey1 = 0, uint32_t
auxkey2 = 0) override;
@@ -48,17 +48,15 @@ struct RamCacheLRU : public RamCache {
   void init(int64_t max_bytes, Vol *vol) override;
 
   // private
-  uint16_t *seen;
+  uint16_t *seen = nullptr;
   Que(RamCacheLRUEntry, lru_link) lru;
-  DList(RamCacheLRUEntry, hash_link) * bucket;
-  int nbuckets;
-  int ibuckets;
-  Vol *vol;
+  DList(RamCacheLRUEntry, hash_link) * bucket = nullptr;
+  int nbuckets = 0;
+  int ibuckets = 0;
+  Vol *vol = nullptr;
 
   void resize_hashtable();
   RamCacheLRUEntry *remove(RamCacheLRUEntry *e);
-
-  RamCacheLRU() : bytes(0), objects(0), seen(nullptr), bucket(nullptr), nbuckets(0), ibuckets(0),
vol(nullptr) {}
 };
 
 int64_t

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

Mime
View raw message