mirror of https://github.com/aria2/aria2
InternalMessageDigestImpl: Fix memory leak
parent
7dc5567cad
commit
c81fd8e194
|
@ -49,7 +49,7 @@ template<size_t dlen,
|
|||
void (*free_fn)(ctx_t**)>
|
||||
class MessageDigestBase : public MessageDigestImpl {
|
||||
public:
|
||||
MessageDigestBase() { reset(); }
|
||||
MessageDigestBase() : ctx_(nullptr) { reset(); }
|
||||
virtual ~MessageDigestBase()
|
||||
{
|
||||
free_fn(&ctx_);
|
||||
|
@ -65,6 +65,7 @@ public:
|
|||
}
|
||||
virtual void reset() CXX11_OVERRIDE
|
||||
{
|
||||
free_fn(&ctx_);
|
||||
init_fn(&ctx_);
|
||||
}
|
||||
virtual void update(const void* data, size_t length) CXX11_OVERRIDE
|
||||
|
|
Loading…
Reference in New Issue