From 5468fae8e0d02016593eb9e7568a09232a8e3c38 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 19 Feb 2020 13:04:48 +0100 Subject: [PATCH] Expr: fix memory leaks in AssignExpr::EvalIntoAggregate() --- src/Expr.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Expr.cc b/src/Expr.cc index 235fa15593..9fd5856d01 100644 --- a/src/Expr.cc +++ b/src/Expr.cc @@ -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");