mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Fix parse-time RecordVal tracking containing duplicates
The same RecordVal was unintentionally being added to the list within a loop over its fields instead of just once per ctor.
This commit is contained in:
parent
0f2e778216
commit
8d6dbc2d46
3 changed files with 11 additions and 7 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
2.6-326 | 2019-05-23 10:49:38 -0700
|
||||||
|
|
||||||
|
* Fix parse-time RecordVal tracking containing duplicates (Jon Siwek, Corelight)
|
||||||
|
|
||||||
2.6-325 | 2019-05-22 23:56:23 -0700
|
2.6-325 | 2019-05-22 23:56:23 -0700
|
||||||
|
|
||||||
* Add leak-checks for new copy operations (Johanna Amann, Corelight)
|
* Add leak-checks for new copy operations (Johanna Amann, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
2.6-325
|
2.6-326
|
||||||
|
|
12
src/Val.cc
12
src/Val.cc
|
@ -2887,6 +2887,12 @@ RecordVal::RecordVal(RecordType* t, bool init_fields) : MutableVal(t)
|
||||||
int n = record_type->NumFields();
|
int n = record_type->NumFields();
|
||||||
val_list* vl = val.val_list_val = new val_list(n);
|
val_list* vl = val.val_list_val = new val_list(n);
|
||||||
|
|
||||||
|
if ( is_parsing )
|
||||||
|
{
|
||||||
|
parse_time_records.emplace_back(this);
|
||||||
|
Ref();
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! init_fields )
|
if ( ! init_fields )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -2928,12 +2934,6 @@ RecordVal::RecordVal(RecordType* t, bool init_fields) : MutableVal(t)
|
||||||
vl->append(def ? def->Ref() : 0);
|
vl->append(def ? def->Ref() : 0);
|
||||||
|
|
||||||
Unref(def);
|
Unref(def);
|
||||||
|
|
||||||
if ( is_parsing )
|
|
||||||
{
|
|
||||||
parse_time_records.emplace_back(this);
|
|
||||||
Ref();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue