Expr: fix memory leak in RecordConstructorExpr::InitVal()

This commit is contained in:
Max Kellermann 2020-02-19 13:13:43 +01:00
parent 5468fae8e0
commit 0a0884edb4

View file

@ -3142,12 +3142,10 @@ Val* RecordConstructorExpr::InitVal(const BroType* t, Val* aggr) const
{
RecordVal* rv = v->AsRecordVal();
RecordVal* ar = rv->CoerceTo(t->AsRecordType(), aggr);
Unref(rv);
if ( ar )
{
Unref(rv);
return ar;
}
}
Error("bad record initializer");