Expr: fix memory leaks in AssignExpr::EvalIntoAggregate()

This commit is contained in:
Max Kellermann 2020-02-19 13:04:48 +01:00
parent 65c4f34385
commit 5468fae8e0

View file

@ -2404,7 +2404,11 @@ void AssignExpr::EvalIntoAggregate(const BroType* t, Val* aggr, Frame* f) const
Val* index = op1->Eval(f);
Val* v = check_and_promote(op2->Eval(f), t->YieldType(), 1);
if ( ! index || ! v )
{
Unref(index);
Unref(v);
return;
}
if ( ! tv->Assign(index, v) )
RuntimeError("type clash in table assignment");