Also, simplify some destructors. xfree() is faster than
safe_free() and both are ok in a destructor.
Detected by Coverity Scan. Issue 740527, 740532, 740533,
740534, 740563,
1241964
memcpy(hdr_len, &buf[1], sizeof(int));
}
-StoreMetaUnpacker::StoreMetaUnpacker (char const *aBuffer, ssize_t aLen, int *anInt) : buf (aBuffer), buflen(aLen), hdr_len(anInt), position(1 + sizeof(int))
+StoreMetaUnpacker::StoreMetaUnpacker(char const *aBuffer, ssize_t aLen, int *anInt) :
+ buf(aBuffer),
+ buflen(aLen),
+ hdr_len(anInt),
+ position(1 + sizeof(int)),
+ type('\0'),
+ length(0),
+ tail(NULL)
{
- assert (aBuffer != NULL);
+ assert(aBuffer != NULL);
}
void
#include "SquidTime.h"
Adaptation::Icap::History::History():
- logType(LOG_TAG_NONE), req_sz(0),
- pastTime(0), concurrencyLevel(0)
+ logType(LOG_TAG_NONE),
+ req_sz(0),
+ pastTime(0),
+ concurrencyLevel(0)
{
+ memset(¤tStart, 0, sizeof(currentStart));
}
void Adaptation::Icap::History::start(const char *context)
#include "StrList.h"
#include "wordlist.h"
-Adaptation::Icap::Options::Options(): error("unconfigured"),
- max_connections(-1), allow204(false),
+Adaptation::Icap::Options::Options() :
+ error("unconfigured"),
+ max_connections(-1),
+ allow204(false),
allow206(false),
- preview(-1), theTTL(-1)
+ preview(-1),
+ theTTL(-1),
+ theTimestamp(0)
{
theTransfers.preview.name = "Transfer-Preview";
theTransfers.preview.kind = xferPreview;
#include "SquidConfig.h"
#include "SquidTime.h"
-//CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, Xaction);
-
Adaptation::Icap::Xaction::Xaction(const char *aTypeName, Adaptation::Icap::ServiceRep::Pointer &aService):
AsyncJob(aTypeName),
Adaptation::Initiate(aTypeName),
attempts(0),
connection(NULL),
theService(aService),
- commBuf(NULL), commBufSize(0),
+ commBuf(NULL),
+ commBufSize(0),
commEof(false),
reuseConnection(true),
isRetriable(true),
isRepeatable(true),
ignoreLastWrite(false),
- connector(NULL), reader(NULL), writer(NULL), closer(NULL),
+ stopReason(NULL),
+ connector(NULL),
+ reader(NULL),
+ writer(NULL),
+ closer(NULL),
alep(new AccessLogEntry),
al(*alep),
cs(NULL)
icapRequest = new HttpRequest;
HTTPMSGLOCK(icapRequest);
icap_tr_start = current_time;
+ memset(&icap_tio_start, 0, sizeof(icap_tio_start));
+ memset(&icap_tio_finish, 0, sizeof(icap_tio_finish));
}
Adaptation::Icap::Xaction::~Xaction()
typedef RefCount<external_acl_format> Pointer;
MEMPROXY_CLASS(external_acl_format);
- external_acl_format() : header(NULL), member(NULL), separator(' ') {}
+ external_acl_format() : type(Format::LFT_NONE), header(NULL), member(NULL), separator(' '), header_id(HDR_BAD_HDR) {}
~external_acl_format() {
xfree(header);
xfree(member);
createSwapSubDirs();
}
-Fs::Ufs::UFSSwapDir::UFSSwapDir(char const *aType, const char *anIOType) : SwapDir(aType), IO(NULL), map(new FileMap()), suggest(0), swaplog_fd (-1), currentIOOptions(new ConfigOptionVector()), ioType(xstrdup(anIOType)), cur_size(0), n_disk_objects(0)
+Fs::Ufs::UFSSwapDir::UFSSwapDir(char const *aType, const char *anIOType) :
+ SwapDir(aType),
+ IO(NULL),
+ fsdata(NULL),
+ map(new FileMap()),
+ suggest(0),
+ l1(16),
+ l2(256),
+ swaplog_fd(-1),
+ currentIOOptions(new ConfigOptionVector()),
+ ioType(xstrdup(anIOType)),
+ cur_size(0),
+ n_disk_objects(0)
{
/* modulename is only set to disk modules that are built, by configure,
* so the Find call should never return NULL here.
file_close(swaplog_fd);
swaplog_fd = -1;
}
- safe_free(ioType);
+ xfree(ioType);
delete map;
delete IO;
delete currentIOOptions;