mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Fix various potential memory leaks.
Though I expect most not to be exercised in practice.
This commit is contained in:
parent
c3a4454892
commit
0b97343ff7
29 changed files with 142 additions and 32 deletions
|
@ -2964,6 +2964,7 @@ Val* IndexExpr::Eval(Frame* f) const
|
|||
if ( v_v1->Size() != v_v2->Size() )
|
||||
{
|
||||
Error("size mismatch, boolean index and vector");
|
||||
Unref(v_result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3803,6 +3804,8 @@ Val* VectorConstructorExpr::InitVal(const BroType* t, Val* aggr) const
|
|||
if ( ! v || ! vec->Assign(i, v) )
|
||||
{
|
||||
Error(fmt("initialization type mismatch at index %d", i), e);
|
||||
if ( ! aggr )
|
||||
Unref(vec);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -5159,6 +5162,7 @@ Val* ListExpr::InitVal(const BroType* t, Val* aggr) const
|
|||
if ( exprs.length() != tl->length() )
|
||||
{
|
||||
Error("index mismatch", t);
|
||||
Unref(v);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue