mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Fix memory leak in HashVal subclass ctors.
The instantiation of OpaqueType here is ref'd by the Val ctor, which has a corresponding deref in the Val dtor, but a deref is still needed for the instantiation itself.
This commit is contained in:
parent
7caa4aa45c
commit
f5d8ed299d
1 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ public:
|
|||
u_char key[MD5_DIGEST_LENGTH],
|
||||
u_char result[MD5_DIGEST_LENGTH]);
|
||||
|
||||
MD5Val() : HashVal(new OpaqueType("md5")) { }
|
||||
MD5Val() : HashVal(new OpaqueType("md5")) { Unref(Type()); }
|
||||
|
||||
protected:
|
||||
friend class Val;
|
||||
|
@ -55,7 +55,7 @@ class SHA1Val : public HashVal {
|
|||
public:
|
||||
static void digest(val_list& vlist, u_char result[SHA_DIGEST_LENGTH]);
|
||||
|
||||
SHA1Val() : HashVal(new OpaqueType("sha1")) { }
|
||||
SHA1Val() : HashVal(new OpaqueType("sha1")) { Unref(Type()); }
|
||||
|
||||
protected:
|
||||
friend class Val;
|
||||
|
@ -74,7 +74,7 @@ class SHA256Val : public HashVal {
|
|||
public:
|
||||
static void digest(val_list& vlist, u_char result[SHA256_DIGEST_LENGTH]);
|
||||
|
||||
SHA256Val() : HashVal(new OpaqueType("sha256")) { }
|
||||
SHA256Val() : HashVal(new OpaqueType("sha256")) { Unref(Type()); }
|
||||
|
||||
protected:
|
||||
friend class Val;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue