mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Expr: fix several memory leaks in BoolExpr::Eval()
This commit is contained in:
parent
6ce1081b38
commit
862f48da45
1 changed files with 8 additions and 0 deletions
|
@ -1631,7 +1631,10 @@ Val* BoolExpr::Eval(Frame* f) const
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! scalar_v || ! vector_v )
|
if ( ! scalar_v || ! vector_v )
|
||||||
|
{
|
||||||
|
Unref(v1);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
VectorVal* result = 0;
|
VectorVal* result = 0;
|
||||||
|
|
||||||
|
@ -1657,13 +1660,18 @@ Val* BoolExpr::Eval(Frame* f) const
|
||||||
// Only case remaining: both are vectors.
|
// Only case remaining: both are vectors.
|
||||||
Val* v2 = op2->Eval(f);
|
Val* v2 = op2->Eval(f);
|
||||||
if ( ! v2 )
|
if ( ! v2 )
|
||||||
|
{
|
||||||
|
Unref(v1);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
VectorVal* vec_v1 = v1->AsVectorVal();
|
VectorVal* vec_v1 = v1->AsVectorVal();
|
||||||
VectorVal* vec_v2 = v2->AsVectorVal();
|
VectorVal* vec_v2 = v2->AsVectorVal();
|
||||||
|
|
||||||
if ( vec_v1->Size() != vec_v2->Size() )
|
if ( vec_v1->Size() != vec_v2->Size() )
|
||||||
{
|
{
|
||||||
|
Unref(v1);
|
||||||
|
Unref(v2);
|
||||||
RuntimeError("vector operands have different sizes");
|
RuntimeError("vector operands have different sizes");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue