mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Expr: fix memory leak in RecordCoerceExpr::Fold()
Don't add a second reference if the `rhs` variable was assigned from
`def->AttrExpr()->Eval(0)`.
Caused by commit af3267acc3
This commit is contained in:
parent
46ecbd400e
commit
e557563c69
1 changed files with 1 additions and 2 deletions
|
@ -3804,8 +3804,7 @@ Val* RecordCoerceExpr::Fold(Val* v) const
|
|||
if ( def )
|
||||
rhs = def->AttrExpr()->Eval(0);
|
||||
}
|
||||
|
||||
if ( rhs )
|
||||
else
|
||||
rhs = rhs->Ref();
|
||||
|
||||
assert(rhs || Type()->AsRecordType()->FieldDecl(i)->FindAttr(ATTR_OPTIONAL));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue