Expr: fix two memory leaks in AssignExpr::InitVal()

This commit is contained in:
Max Kellermann 2020-02-21 18:39:12 +01:00
parent 32786c7645
commit 3b09bb9e46

View file

@ -2480,7 +2480,11 @@ Val* AssignExpr::InitVal(const BroType* t, Val* aggr) const
Val* index = op1->InitVal(tt->Indices(), 0); Val* index = op1->InitVal(tt->Indices(), 0);
Val* v = op2->InitVal(yt, 0); Val* v = op2->InitVal(yt, 0);
if ( ! index || ! v ) if ( ! index || ! v )
{
Unref(index);
Unref(tv);
return 0; return 0;
}
if ( ! tv->ExpandAndInit(index, v) ) if ( ! tv->ExpandAndInit(index, v) )
{ {