diff --git a/src/hasher.cpp b/src/hasher.cpp index a80dc9ae4..766fcf405 100644 --- a/src/hasher.cpp +++ b/src/hasher.cpp @@ -77,7 +77,7 @@ namespace libtorrent { hasher& hasher::operator=(hasher const& h) & { - if (this == &h) return; + if (this == &h) return *this; gcry_md_close(m_context); gcry_md_copy(&m_context, h.m_context); return *this; diff --git a/src/hasher512.cpp b/src/hasher512.cpp index 76b91454d..5706e394c 100644 --- a/src/hasher512.cpp +++ b/src/hasher512.cpp @@ -70,7 +70,7 @@ namespace libtorrent { hasher512& hasher512::operator=(hasher512 const& h) & { - if (this == &h) return; + if (this == &h) return *this; gcry_md_close(m_context); gcry_md_copy(&m_context, h.m_context); return *this;