fixed error handling in pe-crypto

This commit is contained in:
Arvid Norberg 2008-02-09 21:14:49 +00:00
parent ea7253c575
commit 221cdf2bf8
1 changed files with 1 additions and 2 deletions

View File

@ -61,8 +61,7 @@ namespace libtorrent
TORRENT_ASSERT(sizeof(m_dh_prime) == DH_size(m_DH));
DH_generate_key(m_DH);
if (m_DH->pub_key == 0)
if (DH_generate_key(m_DH) == 0 || m_DH->pub_key == 0)
{
DH_free(m_DH);
throw std::bad_alloc();