forked from premiere/premiere-libtorrent
make electric fence happy by not allocating 0 bytes
This commit is contained in:
parent
4693e2c94b
commit
ed39e3c307
|
@ -222,6 +222,7 @@ namespace libtorrent
|
|||
|
||||
void resize(int bits)
|
||||
{
|
||||
TORRENT_ASSERT(bits >= 0);
|
||||
const int b = (bits + 7) / 8;
|
||||
if (m_bytes)
|
||||
{
|
||||
|
@ -238,7 +239,7 @@ namespace libtorrent
|
|||
m_own = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (bits > 0)
|
||||
{
|
||||
m_bytes = (unsigned char*)std::malloc(b);
|
||||
m_own = true;
|
||||
|
|
Loading…
Reference in New Issue