mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
fix opaqueval-related memleak
This commit is contained in:
parent
6acbbe0231
commit
cf6e768ad6
3 changed files with 6 additions and 2 deletions
|
@ -243,6 +243,7 @@ OpaqueType* md5_type;
|
||||||
OpaqueType* sha1_type;
|
OpaqueType* sha1_type;
|
||||||
OpaqueType* sha256_type;
|
OpaqueType* sha256_type;
|
||||||
OpaqueType* entropy_type;
|
OpaqueType* entropy_type;
|
||||||
|
OpaqueType* topk_type;
|
||||||
|
|
||||||
#include "const.bif.netvar_def"
|
#include "const.bif.netvar_def"
|
||||||
#include "types.bif.netvar_def"
|
#include "types.bif.netvar_def"
|
||||||
|
@ -308,6 +309,7 @@ void init_general_global_var()
|
||||||
sha1_type = new OpaqueType("sha1");
|
sha1_type = new OpaqueType("sha1");
|
||||||
sha256_type = new OpaqueType("sha256");
|
sha256_type = new OpaqueType("sha256");
|
||||||
entropy_type = new OpaqueType("entropy");
|
entropy_type = new OpaqueType("entropy");
|
||||||
|
topk_type = new OpaqueType("topk");
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_net_var()
|
void init_net_var()
|
||||||
|
|
|
@ -248,6 +248,7 @@ extern OpaqueType* md5_type;
|
||||||
extern OpaqueType* sha1_type;
|
extern OpaqueType* sha1_type;
|
||||||
extern OpaqueType* sha256_type;
|
extern OpaqueType* sha256_type;
|
||||||
extern OpaqueType* entropy_type;
|
extern OpaqueType* entropy_type;
|
||||||
|
extern OpaqueType* topk_type;
|
||||||
|
|
||||||
// Initializes globals that don't pertain to network/event analysis.
|
// Initializes globals that don't pertain to network/event analysis.
|
||||||
extern void init_general_global_var();
|
extern void init_general_global_var();
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "CompHash.h"
|
#include "CompHash.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Serializer.h"
|
#include "Serializer.h"
|
||||||
|
#include "NetVar.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Topk {
|
namespace Topk {
|
||||||
|
@ -36,7 +37,7 @@ HashKey* TopkVal::GetHash(Val* v) const
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(new OpaqueType("topk"))
|
TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(topk_type)
|
||||||
{
|
{
|
||||||
elementDict = new PDict(Element);
|
elementDict = new PDict(Element);
|
||||||
elementDict->SetDeleteFunc(topk_element_hash_delete_func);
|
elementDict->SetDeleteFunc(topk_element_hash_delete_func);
|
||||||
|
@ -46,7 +47,7 @@ TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(new OpaqueType("topk"))
|
||||||
pruned = false;
|
pruned = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TopkVal::TopkVal() : OpaqueVal(new OpaqueType("topk"))
|
TopkVal::TopkVal() : OpaqueVal(topk_type)
|
||||||
{
|
{
|
||||||
elementDict = new PDict(Element);
|
elementDict = new PDict(Element);
|
||||||
elementDict->SetDeleteFunc(topk_element_hash_delete_func);
|
elementDict->SetDeleteFunc(topk_element_hash_delete_func);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue