]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix initialization of helper and doubly-linked list objects
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 2 Jan 2013 03:16:45 +0000 (20:16 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 2 Jan 2013 03:16:45 +0000 (20:16 -0700)
  Detected by Coverity Scan. Issue 740565.

src/dlink.h
src/helper.h

index d4a8bb361a66e323bdce39b0b5aeb23ae8f92012..7ec7545665ee13728c4d4f25e7b6f60dd8a06698 100644 (file)
@@ -41,7 +41,11 @@ public:
     dlink_node *next;
 };
 
-struct dlink_list {
+class dlink_list
+{
+public:
+    dlink_list() : head(NULL), tail(NULL) {}
+
     dlink_node *head;
     dlink_node *tail;
 };
index 1ee9d5e904b8b998efac05ec4ea88f655f521c7e..48af9159767c4a6b3aae242f4370db1bab21c351 100644 (file)
@@ -48,7 +48,15 @@ typedef void HLPCB(void *, const HelperReply &reply);
 class helper
 {
 public:
-    inline helper(const char *name) : cmdline(NULL), id_name(name), eom('\n') {}
+    inline helper(const char *name) :
+            cmdline(NULL),
+            id_name(name),
+            ipc_type(0),
+            last_queue_warn(0),
+            last_restart(0),
+            eom('\n') {
+        memset(&stats, 0, sizeof(stats));
+    }
     ~helper();
 
 public:
@@ -77,7 +85,7 @@ private:
 class statefulhelper : public helper
 {
 public:
-    inline statefulhelper(const char *name) : helper(name) {};
+    inline statefulhelper(const char *name) : helper(name), datapool(NULL), IsAvailable(NULL), OnEmptyQueue(NULL) {};
     inline ~statefulhelper() {};
 
 public: