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:52:30 UTC

[trafficserver] branch master updated: coverity 1021760: Uninitialized scalar 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  2802acf   coverity 1021760: Uninitialized scalar field
2802acf is described below

commit 2802acf847f8c34da278c566962ca8c22321e4cd
Author: Bryan Call <bc...@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" <co...@trafficserver.apache.org>'].