mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Avoid resource leaks (Coverity-1402818, Coverity-1402812)
This commit is contained in:
parent
4db6d00372
commit
69023a0c75
1 changed files with 2 additions and 2 deletions
|
@ -492,25 +492,25 @@ bool TopkVal::DoUnserialize(const broker::data& data)
|
|||
|
||||
while ( i < numElements )
|
||||
{
|
||||
Bucket* b = new Bucket();
|
||||
auto elements_count = caf::get_if<uint64>(&(*v)[idx++]);
|
||||
auto count = caf::get_if<uint64>(&(*v)[idx++]);
|
||||
|
||||
if ( ! (elements_count && count) )
|
||||
return false;
|
||||
|
||||
Bucket* b = new Bucket();
|
||||
b->count = *count;
|
||||
b->bucketPos = buckets.insert(buckets.end(), b);
|
||||
|
||||
for ( uint64_t j = 0; j < *elements_count; j++ )
|
||||
{
|
||||
Element* e = new Element();
|
||||
auto epsilon = caf::get_if<uint64>(&(*v)[idx++]);
|
||||
Val* val = bro_broker::data_to_val((*v)[idx++], type);
|
||||
|
||||
if ( ! (epsilon && val) )
|
||||
return false;
|
||||
|
||||
Element* e = new Element();
|
||||
e->epsilon = *epsilon;
|
||||
e->value = val;
|
||||
e->parent = b;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue