mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fixing a few Coverity warnings.
This commit is contained in:
parent
85213e6b55
commit
50945a6359
6 changed files with 8 additions and 4 deletions
|
@ -21,7 +21,7 @@ public:
|
|||
void MinimizeTime() { time = -HUGE_VAL; }
|
||||
|
||||
protected:
|
||||
PQ_Element() { }
|
||||
PQ_Element() { time = 0; offset = -1; }
|
||||
double time;
|
||||
int offset;
|
||||
};
|
||||
|
|
|
@ -2401,7 +2401,7 @@ bool TableVal::DoSerialize(SerialInfo* info) const
|
|||
}
|
||||
|
||||
// Serialize index.
|
||||
if ( ! state->did_index )
|
||||
if ( k && ! state->did_index )
|
||||
{
|
||||
// Indices are rather small, so we disable suspension
|
||||
// here again.
|
||||
|
|
|
@ -12,7 +12,8 @@ using namespace analyzer::conn_size;
|
|||
|
||||
ConnSize_Analyzer::ConnSize_Analyzer(Connection* c)
|
||||
: Analyzer("CONNSIZE", c),
|
||||
orig_bytes(), resp_bytes(), orig_pkts(), resp_pkts()
|
||||
orig_bytes(), resp_bytes(), orig_pkts(), resp_pkts(),
|
||||
orig_bytes_thresh(), resp_bytes_thresh(), orig_pkts_thresh(), resp_pkts_thresh()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ Entropy::Entropy(RecordVal* args, File* file)
|
|||
{
|
||||
//entropy->Init();
|
||||
entropy = new EntropyVal;
|
||||
fed = false;
|
||||
}
|
||||
|
||||
Entropy::~Entropy()
|
||||
|
|
|
@ -1204,7 +1204,7 @@ int Manager::SendEntryTable(Stream* i, const Value* const *vals)
|
|||
ih->idxkey = new HashKey(k->Key(), k->Size(), k->Hash());
|
||||
ih->valhash = valhash;
|
||||
|
||||
if ( stream->event && updated )
|
||||
if ( oldval && stream->event && updated )
|
||||
Ref(oldval); // otherwise it is no longer accessible after the assignment
|
||||
|
||||
stream->tab->Assign(idxval, k, valval);
|
||||
|
|
|
@ -646,6 +646,8 @@ patricia_search_all (patricia_tree_t *patricia, prefix_t *prefix, patricia_node_
|
|||
|
||||
// ok, now we have an upper bound of how much we can return. Let's just alloc that...
|
||||
patricia_node_t **outlist = calloc(cnt, sizeof(patricia_node_t*));
|
||||
if (outlist == NULL)
|
||||
out_of_memory("patrica/patricia_search_all: unable to allocate memory");
|
||||
|
||||
while (--cnt >= 0) {
|
||||
node = stack[cnt];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue