forked from premiere/premiere-libtorrent
throw when packet_buffer fails to allocate memory
This commit is contained in:
parent
c871610408
commit
9597dcda87
|
@ -157,6 +157,9 @@ namespace libtorrent {
|
|||
new_size <<= 1;
|
||||
|
||||
void** new_storage = (void**)malloc(sizeof(void*) * new_size);
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
if (new_storage == NULL) throw std::bad_alloc();
|
||||
#endif
|
||||
|
||||
for (index_type i = 0; i < new_size; ++i)
|
||||
new_storage[i] = 0;
|
||||
|
|
Loading…
Reference in New Issue