mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +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 )
|
if ( def )
|
||||||
rhs = def->AttrExpr()->Eval(0);
|
rhs = def->AttrExpr()->Eval(0);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if ( rhs )
|
|
||||||
rhs = rhs->Ref();
|
rhs = rhs->Ref();
|
||||||
|
|
||||||
assert(rhs || Type()->AsRecordType()->FieldDecl(i)->FindAttr(ATTR_OPTIONAL));
|
assert(rhs || Type()->AsRecordType()->FieldDecl(i)->FindAttr(ATTR_OPTIONAL));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue