From: Amos Jeffries Date: Wed, 2 Jan 2013 03:16:45 +0000 (-0700) Subject: Fix initialization of helper and doubly-linked list objects X-Git-Tag: SQUID_3_4_0_1~399 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8347c5379ae31406b3df8963ff2360bb96f5da9;p=thirdparty%2Fsquid.git Fix initialization of helper and doubly-linked list objects Detected by Coverity Scan. Issue 740565. --- diff --git a/src/dlink.h b/src/dlink.h index d4a8bb361a..7ec7545665 100644 --- a/src/dlink.h +++ b/src/dlink.h @@ -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; }; diff --git a/src/helper.h b/src/helper.h index 1ee9d5e904..48af915976 100644 --- a/src/helper.h +++ b/src/helper.h @@ -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: