InternalMessageDigestImpl: Fix memory leak

pull/131/merge
Tatsuhiro Tsujikawa 2013-09-25 23:58:59 +09:00
parent 7dc5567cad
commit c81fd8e194
1 changed files with 2 additions and 1 deletions

View File

@ -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