mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Fixing more memory leaks.
This commit is contained in:
parent
95cf662ff5
commit
e8c9c2ee0b
1 changed files with 22 additions and 3 deletions
|
@ -181,16 +181,24 @@ char* CompositeHash::SingleValHash(int type_check, char* kp0,
|
|||
Val* key = lv->Index(i);
|
||||
if ( ! (kp1 = SingleValHash(type_check, kp1, key->Type(), key,
|
||||
false)) )
|
||||
{
|
||||
Unref(lv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( ! v->Type()->IsSet() )
|
||||
{
|
||||
Val* val = tv->Lookup(key);
|
||||
if ( ! (kp1 = SingleValHash(type_check, kp1, val->Type(),
|
||||
val, false)) )
|
||||
{
|
||||
Unref(lv);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Unref(lv);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -454,16 +462,27 @@ int CompositeHash::SingleTypeKeySize(BroType* bt, const Val* v,
|
|||
Val* key = lv->Index(i);
|
||||
sz = SingleTypeKeySize(key->Type(), key, type_check, sz, false,
|
||||
calc_static_size);
|
||||
if ( ! sz ) return 0;
|
||||
if ( ! sz )
|
||||
{
|
||||
Unref(lv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( ! bt->IsSet() )
|
||||
{
|
||||
Val* val = tv->Lookup(key);
|
||||
sz = SingleTypeKeySize(val->Type(), val, type_check, sz,
|
||||
false, calc_static_size);
|
||||
if ( ! sz ) return 0;
|
||||
if ( ! sz )
|
||||
{
|
||||
Unref(lv);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Unref(lv);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue