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

Caused by commit b1fd161274
This commit is contained in:
Max Kellermann 2020-02-24 13:37:51 +01:00
parent c074122f13
commit 46ecbd400e

View file

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